:root {
  --th-black: #080808;
  --th-yellow: #ffd400;
  --th-white: #ffffff;
  --th-gray-050: #fafafa;
  --th-gray-100: #f1f1ef;
  --th-gray-300: #c9c9c9;
  --th-gray-600: #5d5d5d;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--th-gray-100);
  color: #111111;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans JP", sans-serif;
  line-height: 1.55;
}

button,
input,
select { font: inherit; }

a { color: inherit; }

img { max-width: 100%; height: auto; }

.site-shell {
  position: relative;
  width: min(100%, 1160px);
  margin: 0 auto;
  overflow: hidden;
  background: var(--th-white);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.12);
}

.update-strip {
  padding: 8px 16px;
  background: var(--th-yellow);
  color: var(--th-black);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.site-header {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 5px solid var(--th-yellow);
  background: var(--th-white);
}

.brand {
  display: block;
  min-width: 0;
  width: min(100%, 640px);
}

.brand > a { display: block; text-decoration: none; }
.brand .custom-logo-link { display: block; }
.brand .custom-logo { display: block; width: auto; max-width: 100%; height: auto; max-height: 82px; }
.brand__source-logo {
  display: block;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 3 / 1;
  height: auto;
  object-fit: cover;
  object-position: center;
}

.menu-toggle,
.menu-close,
.buylist-dialog__close {
  border: 2px solid var(--th-black);
  border-radius: 4px;
  background: var(--th-yellow);
  color: var(--th-black);
  cursor: pointer;
  font-weight: 700;
}

.menu-toggle { padding: 10px 12px; white-space: nowrap; }
.menu-close,
.buylist-dialog__close { padding: 7px 10px; }

.site-menu {
  display: none;
  position: absolute;
  z-index: 20;
  top: calc(100% + 5px);
  right: 14px;
  width: min(360px, calc(100% - 28px));
  border: 3px solid var(--th-black);
  background: var(--th-white);
  box-shadow: 8px 8px 0 var(--th-yellow);
}

.site-menu.is-open { display: block; }

.site-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--th-black);
  color: var(--th-white);
}

.site-menu__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-menu__list li { margin: 0; }

.site-menu__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 12px;
  border-bottom: 1px solid #d6d6d6;
  color: #111111;
  font-weight: 700;
  text-decoration: none;
}

.site-menu__list li:last-child a { border-bottom: 0; }
.site-menu__list a:hover { background: #fff8c4; }

.site-main { background: var(--th-white); }

.postal-section,
.regions-section { padding: 24px 16px 28px; }

.date-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.daily-label {
  display: inline-block;
  margin-bottom: 7px;
  padding: 5px 9px;
  background: var(--th-yellow);
  color: var(--th-black);
  font-size: 0.78rem;
  font-weight: 700;
}

.date-heading h1 {
  margin: 0;
  font-size: clamp(1.08rem, 4vw, 1.55rem);
  line-height: 1.35;
}

.date-heading time {
  flex: 0 0 auto;
  color: var(--th-gray-600);
  font-size: 0.72rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-left: 8px solid var(--th-yellow);
  background: var(--th-black);
  color: var(--th-white);
  font-weight: 700;
}

.section-heading small {
  color: var(--th-yellow);
  font-size: 0.72rem;
  white-space: nowrap;
}

.section-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
  color: var(--th-gray-600);
  font-size: 0.76rem;
}

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

.buylist-card {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--th-gray-300);
  background: var(--th-white);
}

.buylist-grid--postal .buylist-card:first-child { border: 3px solid var(--th-yellow); }

.buylist-card__zoom {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--th-white);
  cursor: zoom-in;
}

.buylist-card__zoom img {
  display: block;
  width: 100%;
  background: var(--th-white);
}

.buylist-card__paper { padding: 7px; }

.buylist-card__mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 5px;
  padding: 4px;
  overflow: hidden;
  border-top: 2px solid var(--th-black);
  border-bottom: 2px solid var(--th-black);
  font-size: clamp(0.38rem, 1.6vw, 0.62rem);
  white-space: nowrap;
}

.buylist-card__mini-head b {
  max-width: 50%;
  padding: 2px 4px;
  overflow: hidden;
  background: var(--th-black);
  color: var(--th-white);
  text-overflow: ellipsis;
}

.buylist-card__matrix {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
}

.buylist-card__matrix span {
  display: block;
  aspect-ratio: 0.62;
  border: 1px solid #dddddd;
  background:
    radial-gradient(circle at 70% 26%, #fff2a2 0 12%, transparent 13%),
    linear-gradient(145deg, #d5a335 0 35%, #3e7790 36% 68%, #f0f0ed 69%);
  border-bottom: 4px solid var(--th-yellow);
}

.buylist-card__matrix span:nth-child(6n+2) { background-color: #5b9f94; filter: hue-rotate(25deg); }
.buylist-card__matrix span:nth-child(6n+3) { filter: hue-rotate(65deg); }
.buylist-card__matrix span:nth-child(6n+4) { filter: hue-rotate(115deg); }
.buylist-card__matrix span:nth-child(6n+5) { filter: hue-rotate(170deg); }
.buylist-card__matrix span:nth-child(6n+6) { filter: hue-rotate(225deg); }

.buylist-card__caption {
  margin: 0;
  padding: 6px 7px;
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: normal;
}

.buylist-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 5px;
  margin: 0;
  padding: 7px;
  overflow: hidden;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: left;
}

.buylist-card__meta span,
.buylist-card__meta time {
  overflow: hidden;
  text-overflow: ellipsis;
}

.buylist-card__meta time { flex: 0 0 auto; color: var(--th-gray-600); font-weight: 400; }

.buylist-card__link {
  display: block;
  padding: 7px;
  border-top: 1px solid #dedede;
  background: #fff8c4;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.oripa-ad {
  margin: 0 16px 28px;
  border: 3px solid var(--th-black);
  background: var(--th-yellow);
  box-shadow: 7px 7px 0 var(--th-black);
}

.oripa-ad__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.oripa-pack {
  position: relative;
  display: grid;
  width: 76px;
  height: 92px;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--th-black);
  background: var(--th-black);
  color: var(--th-yellow);
  font-weight: 700;
  transform: rotate(-3deg);
}

.oripa-pack::before,
.oripa-pack::after {
  position: absolute;
  width: 135%;
  height: 7px;
  background: var(--th-yellow);
  content: "";
  transform: rotate(-35deg);
}

.oripa-pack::before { top: 12px; }
.oripa-pack::after { bottom: 11px; }
.oripa-pack span { position: relative; z-index: 1; }

.ad-label {
  display: inline-block;
  margin-bottom: 5px;
  padding: 3px 6px;
  background: var(--th-black);
  color: var(--th-white);
  font-size: 0.68rem;
  font-weight: 700;
}

.oripa-ad__copy strong { display: block; margin-bottom: 3px; }
.oripa-ad__copy p { margin: 0; color: #353535; font-size: 0.76rem; }

.oripa-ad__cta {
  display: block;
  padding: 10px 12px;
  background: var(--th-black);
  color: var(--th-white);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.oripa-ad__cta--disabled { color: #bdbdbd; }

.region-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 11px 0 4px;
}

.region-nav a {
  padding: 7px 9px;
  border: 1px solid var(--th-black);
  background: var(--th-white);
  font-size: 0.74rem;
  font-weight: 700;
  text-decoration: none;
}

.region-nav a:first-child,
.region-nav a:hover { background: var(--th-yellow); }

.region-block {
  margin-top: 20px;
  scroll-margin-top: 12px;
}

.region-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 3px solid var(--th-black);
}

.region-heading__number {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  background: var(--th-yellow);
  color: var(--th-black);
  font-weight: 700;
}

.region-heading h2 { margin: 0; font-size: 1rem; }
.region-heading__count { margin-left: auto; color: var(--th-gray-600); font-size: 0.72rem; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px 20px;
  padding: 18px 16px;
  background: var(--th-black);
  color: var(--th-white);
  font-size: 0.74rem;
}

.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.buylist-dialog {
  width: min(760px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 0;
  border: 3px solid var(--th-black);
  background: var(--th-white);
  color: #111111;
  box-shadow: 8px 8px 0 var(--th-yellow);
}

.buylist-dialog::backdrop { background: rgba(0, 0, 0, 0.76); }

.buylist-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--th-black);
  color: var(--th-white);
}

.buylist-dialog__body {
  overflow: auto;
  padding: 12px;
  background: #eeeeee;
  touch-action: pan-x pan-y pinch-zoom;
}
.buylist-dialog__body img {
  display: block;
  width: auto;
  min-width: 100%;
  max-width: none;
  height: auto;
  background: var(--th-white);
}

@media (min-width: 760px) {
  .site-header,
  .postal-section,
  .regions-section {
    padding-left: 34px;
    padding-right: 34px;
  }

  .buylist-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

  .buylist-card__meta { flex-direction: row; align-items: center; }

  .oripa-ad { margin-left: 34px; margin-right: 34px; }
  .oripa-ad__inner { grid-template-columns: auto minmax(0, 1fr) auto; padding: 18px 22px; }
  .oripa-ad__cta { min-width: 210px; }
}

@media (max-width: 420px) {
  .site-header { grid-template-columns: minmax(0, 1fr) 54px; gap: 8px; padding: 8px; }
  .menu-toggle { padding: 8px 5px; font-size: 0.76rem; }
  .postal-section,
  .regions-section { padding-left: 12px; padding-right: 12px; }
  .oripa-ad { margin-left: 12px; margin-right: 12px; }
  .date-heading { align-items: start; }
  .date-heading time { padding-top: 31px; }
  .section-heading { padding: 10px; }
  .oripa-ad__inner { grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .oripa-pack { width: 68px; height: 84px; }
  .oripa-ad__cta { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
