/*
Theme Name: Marche Link
Theme URI: https://example.com/marche-link
Author: Marche Link
Description: 山口県のハンドメイド作家・イベント情報ポータルのオリジナルテーマ
Version: 0.2.2
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: marche-link
*/

:root {
  --ml-pink: #e92f70;
  --ml-pink-soft: #fff3f6;
  --ml-green: #55ad99;
  --ml-ink: #241d1c;
  --ml-muted: #6c6561;
  --ml-line: #efdeda;
  --ml-cream: #fffaf6;
  --ml-white: #fff;
  --ml-radius: 8px;
  --ml-max: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ml-ink);
  background: #fffcfa;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  font-size: 14px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.ml-container { width: min(calc(100% - 48px), var(--ml-max)); margin-inline: auto; }

.site-header { height: 82px; background: rgba(255,255,255,.97); border-bottom: 1px solid #f5efeb; position: relative; z-index: 20; }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 32px; }
.site-brand { flex: 0 0 270px; display: flex; align-items: center; gap: 12px; }
.site-brand__mark { width: 48px; height: 46px; position: relative; }
.site-brand__mark::before { content: ""; position: absolute; left: 22px; top: 0; width: 2px; height: 40px; background: #c49a6c; }
.site-brand__mark::after { content: ""; position: absolute; left: 6px; bottom: 3px; width: 39px; height: 22px; border-radius: 5px 5px 22px 22px; background: conic-gradient(from 224deg at 50% 0, #eb6f86 0 18%, #f6b633 18% 38%, #5bb3a1 38% 58%, #fff 58% 66%, #e95779 66% 82%, #f6b633 82% 100%); }
.site-brand__flag { position: absolute; z-index: 2; top: 1px; left: 24px; width: 15px; height: 11px; background: #f6b500; clip-path: polygon(0 0,100% 25%,0 100%); }
.site-brand__name { font-size: 24px; line-height: 1; font-weight: 700; letter-spacing: .19em; white-space: nowrap; }
.site-brand__prefecture { margin-top: 8px; color: #c9903d; font-size: 8px; line-height: 1; font-weight: 700; text-align: center; letter-spacing: .55em; }
.site-header__tagline { flex: 0 0 190px; margin: 0; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 12px; font-weight: 600; line-height: 1.6; }
.primary-nav { margin-left: auto; }
.primary-nav ul { display: flex; align-items: center; gap: 35px; margin: 0; padding: 0; list-style: none; }
.primary-nav a { display: block; padding: 12px 0; font-size: 12px; font-weight: 700; white-space: nowrap; }
.primary-nav a:hover, .primary-nav a:focus-visible { color: var(--ml-pink); }
.menu-toggle { display: none; margin-left: auto; width: 44px; height: 44px; padding: 10px; color: var(--ml-ink); background: transparent; border: 0; cursor: pointer; }
.menu-toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: currentColor; transition: .2s; }

.hero { min-height: 324px; overflow: hidden; background-color: var(--ml-cream); position: relative; }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .75; background-image: radial-gradient(circle at 5% 13%, #ef9caf 0 6px, transparent 7px), radial-gradient(circle at 41% 8%, #f2bd5c 0 6px, transparent 7px), radial-gradient(circle at 44% 65%, #a7d9d6 0 6px, transparent 7px), radial-gradient(circle at 24% 91%, #efbc64 0 5px, transparent 6px), radial-gradient(circle at 8% 80%, #9bd3d2 0 6px, transparent 7px); }
.hero__inner { min-height: 324px; display: grid; grid-template-columns: 46% 54%; position: relative; }
.hero__copy { position: relative; z-index: 2; align-self: center; padding: 25px 20px 24px 62px; }
.hero__copy::before { content: "❧"; position: absolute; left: 0; top: 58px; font-size: 58px; line-height: 1; font-family: serif; font-weight: 400; transform: rotate(-25deg); }
.hero__title { margin: 0 0 31px; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(38px, 4.05vw, 57px); font-weight: 500; line-height: 1.55; letter-spacing: .12em; }
.hero__lead { margin: 0; font-size: 14px; line-height: 2; font-weight: 600; }
.hero__visual { min-width: 0; position: relative; overflow: hidden; }
.hero__visual img { position: absolute; width: 1210px; max-width: none; left: -583px; top: -92px; }
.hero__visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--ml-cream) 0, rgba(255,250,246,.2) 18%, transparent 42%); pointer-events: none; }

.featured-events { position: relative; z-index: 3; margin-top: -2px; padding-bottom: 28px; background: #fffcfa; }
.featured-events__panel { display: grid; grid-template-columns: 210px minmax(0, 1fr) 205px; gap: 24px; align-items: center; min-height: 167px; padding: 24px 22px; border: 1px solid #f3b8c9; border-radius: 9px; background: rgba(255,255,255,.93); box-shadow: 0 5px 18px rgba(91,55,43,.035); }
.featured-events__heading { align-self: start; padding-top: 3px; }
.featured-events__title { display: flex; align-items: center; gap: 13px; margin: 0 0 20px; color: var(--ml-pink); font-size: 21px; line-height: 1.3; }
.featured-events__icon { font-size: 33px; font-weight: 400; }
.featured-events__text { margin: 0; font-size: 12px; font-weight: 600; white-space: nowrap; }
.event-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.event-card { min-width: 0; display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; align-items: center; }
.event-card__thumb { width: 104px; aspect-ratio: 1.05; overflow: hidden; border-radius: 5px; background: #eee; position: relative; }
.event-card__thumb img { position: absolute; width: 977px; max-width: none; }
.event-card:nth-child(1) img { left: -54px; top: -406px; }
.event-card:nth-child(2) img { left: -301px; top: -406px; }
.event-card:nth-child(3) img { left: -522px; top: -406px; }
.event-card__date { margin: 0 0 5px; color: var(--ml-pink); font-size: 13px; font-weight: 800; }
.event-card__name { margin: 0 0 4px; font-size: 12px; font-weight: 700; line-height: 1.55; }
.event-card__place { margin: 0; font-size: 11px; line-height: 1.5; }
.featured-events__action { justify-self: end; }
.ml-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; color: #fff; background: var(--ml-pink); border: 1px solid var(--ml-pink); border-radius: 5px; font-size: 13px; font-weight: 700; box-shadow: 0 3px 8px rgba(233,47,112,.12); transition: transform .15s, opacity .15s; }
.ml-button:hover, .ml-button:focus-visible { opacity: .88; transform: translateY(-1px); }
.phase-note { padding: 24px 0 70px; color: #9b8f89; text-align: center; font-size: 12px; }
.calendar-area { padding: 0 0 62px; }
.calendar-layout { width: 100%; display: grid; grid-template-columns: minmax(0, 70%) minmax(0, 30%); gap: 0; align-items: start; }
.event-calendar { min-width: 0; }
.calendar-layout > .event-calendar { width: 100%; padding-right: 30px; }
.event-calendar__title { display: flex; align-items: center; gap: 12px; margin: 0 0 7px; padding-bottom: 8px; border-bottom: 1px solid #e9e1de; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 20px; line-height: 1.4; letter-spacing: .08em; }
.event-calendar__title span { font-family: sans-serif; font-size: 20px; transform: rotate(2deg); }
.event-calendar__nav { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; min-height: 48px; }
.event-calendar__month { display: flex; justify-content: center; align-items: baseline; gap: 10px; min-width: 0; }
.event-calendar__nav strong { text-align: center; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 20px; }
.event-calendar__today { color: var(--ml-muted); font-size: 11px !important; line-height: 1; text-decoration: underline; text-underline-offset: 3px; }
.event-calendar__nav > a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; transition: color .15s, background .15s; }
.event-calendar__nav > a:last-child { justify-self: end; }
.event-calendar__nav > a:hover, .event-calendar__nav > a:focus-visible { color: var(--ml-pink); background: var(--ml-pink-soft); }
.event-calendar__table-wrap { width: 100%; overflow: hidden; border: 1px solid #e6dfdc; border-radius: 5px; background: #fff; }
.event-calendar__table, table.event-calendar__table { width: 100% !important; min-width: 100%; margin: 0; border-collapse: collapse; table-layout: fixed; }
.event-calendar__table th { height: 30px; padding: 3px; background: #fbf7f3; border-right: 1px solid #e8e2df; font-size: 12px; line-height: 1; }
.event-calendar__table td { width: 14.2857%; height: 72px; padding: 7px; vertical-align: top; border-top: 1px solid #e8e2df; border-right: 1px solid #e8e2df; background: #fff; }
.event-calendar__table th:last-child, .event-calendar__table td:last-child { border-right: 0; }
.event-calendar__table .is-empty { background: #fdfcfb; }
.event-calendar__table .is-saturday, .event-calendar__table th.is-saturday { color: #2389c7; }
.event-calendar__table .is-sunday, .event-calendar__table th.is-sunday { color: var(--ml-pink); }
.event-calendar__day { display: block; min-height: 23px; font-size: 13px; line-height: 1.4; text-align: center; font-weight: 600; }
.event-calendar__icons { display: flex; justify-content: center; align-items: center; gap: 3px; }
.event-calendar .calendar-category-icon { display: inline-block; flex: 0 0 auto; width: 22px !important; max-width: 22px !important; height: 22px !important; object-fit: cover; border-radius: 50%; }
.event-calendar__legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px 38px; margin: 15px 0 0; padding: 0; list-style: none; }
.event-calendar__legend li { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.event-calendar__legend .calendar-category-icon { width: 27px !important; max-width: 27px !important; height: 27px !important; }
.calendar-sidebar { width: 100%; min-width: 0; min-height: 1px; }
.site-footer { padding: 28px 0; background: #fff8f4; border-top: 1px solid var(--ml-line); text-align: center; font-size: 11px; }

@media (max-width: 1080px) {
  .site-header__tagline { display: none; }
  .site-brand { flex-basis: auto; }
  .primary-nav ul { gap: 22px; }
  .featured-events__panel { grid-template-columns: 180px minmax(0, 1fr); }
  .featured-events__action { grid-column: 1 / -1; justify-self: center; }
}

@media (max-width: 820px) {
  .ml-container { width: min(calc(100% - 32px), var(--ml-max)); }
  .site-header { height: 68px; }
  .site-brand__mark { width: 38px; height: 38px; transform: scale(.83); transform-origin: left center; }
  .site-brand__name { font-size: 19px; }
  .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 68px; margin: 0; padding: 10px 20px 20px; background: #fff; border-bottom: 1px solid var(--ml-line); box-shadow: 0 8px 15px rgba(45,30,25,.08); }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { display: grid; gap: 0; }
  .primary-nav a { padding: 11px 8px; border-bottom: 1px solid #f7efec; }
  .menu-toggle { display: block; }
  .hero { min-height: 0; }
  .hero__inner { min-height: 0; grid-template-columns: 1fr; }
  .hero__copy { min-height: 290px; padding: 48px 18px 36px 45px; }
  .hero__copy::before { left: -5px; top: 80px; font-size: 45px; }
  .hero__title { margin-bottom: 22px; font-size: clamp(34px, 10vw, 48px); line-height: 1.45; }
  .hero__lead { font-size: 13px; line-height: 1.8; }
  .hero__visual { height: 260px; }
  .hero__visual img { width: 930px; left: calc(50% - 590px); top: -70px; }
  .hero__visual::after { background: linear-gradient(180deg, var(--ml-cream) 0, transparent 27%); }
  .featured-events { padding-top: 16px; }
  .featured-events__panel { display: block; padding: 20px 18px; }
  .featured-events__heading { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
  .featured-events__title { margin: 0; font-size: 19px; }
  .featured-events__text { white-space: normal; }
  .event-list { display: flex; gap: 13px; overflow-x: auto; padding: 2px 2px 13px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
  .event-card { flex: 0 0 270px; scroll-snap-align: start; }
  .featured-events__action { margin-top: 12px; text-align: center; }
  .ml-button { width: 100%; min-height: 48px; }
  .calendar-area { padding-bottom: 42px; }
  .calendar-layout { grid-template-columns: 1fr; gap: 0; }
  .calendar-layout > .event-calendar { padding-right: 0; }
  .calendar-sidebar { display: none; }
  .event-calendar__table td { height: 54px; padding: 4px 2px; }
  .event-calendar__icons { gap: 1px; }
  .event-calendar .event-calendar__icons .calendar-category-icon { width: 18px !important; max-width: 18px !important; height: 18px !important; }
  .event-calendar__legend { justify-content: flex-start; gap: 12px 22px; }
}

@media (max-width: 430px) {
  .ml-container { width: min(calc(100% - 24px), var(--ml-max)); }
  .site-brand__name { font-size: 17px; letter-spacing: .14em; }
  .site-brand__prefecture { font-size: 7px; }
  .hero__copy { min-height: 270px; padding-top: 40px; }
  .hero__title { font-size: 34px; }
  .hero__visual { height: 220px; }
  .featured-events__heading { display: block; }
  .featured-events__text { margin-top: 9px; }
  .event-calendar__title { font-size: 18px; }
  .event-calendar__nav { min-height: 44px; }
  .event-calendar__nav strong { font-size: 18px; }
  .event-calendar__table th { font-size: 11px; }
  .event-calendar__table td { height: 50px; }
  .event-calendar__day { min-height: 20px; font-size: 12px; }
  .event-calendar .event-calendar__icons .calendar-category-icon { width: 16px !important; max-width: 16px !important; height: 16px !important; }
  .event-calendar .event-calendar__legend .calendar-category-icon { width: 22px !important; max-width: 22px !important; height: 22px !important; }
}
