/* =========================
   Jun Sports Hokkaido - EVENT
   Ads-safe Unified CSS
   - Prevent layout break by Google AdSense (auto-placed / vignette)
   ========================= */

:root{
  --bg: #f3f4f6;                 /* page bg */
  --panel: #ffffff;              /* card bg */
  --line: rgba(0,0,0,.12);       /* border */
  --text: #111827;               /* text */
  --muted: rgba(17,24,39,.65);   /* sub text */

  --navy: #071a3a;
  --navy2:#020714;
  --gold1:#C9A24D;
  --gold2:#F5E1A4;

  --shadow: 0 14px 32px rgba(0,0,0,.12);
  --shadow2: 0 22px 42px rgba(0,0,0,.16);

  --radius: 18px;
  --radius2: 22px;

  --container: 1200px;
  --gap: 28px;

  --header-h: 0px;              /* fixed header height if needed */

  /* scrollbar width (desktop). mobile ~0 */
  --sbw: calc(100vw - 100%);
}

/* =========================================
   Global: stop horizontal break by ads/vignette
   ========================================= */
html, body{
  max-width: 100%;
  /* clip is best; fallback hidden works everywhere */
  overflow-x: clip;
}
@supports not (overflow-x: clip){
  html, body{ overflow-x: hidden; }
}

/* AdSense inserted nodes: keep inside viewport */
ins.adsbygoogle,
.google-auto-placed,
iframe[id^="google_ads_iframe"],
iframe[src*="doubleclick"],
iframe[src*="googlesyndication"]{
  max-width: 100% !important;
}

/* Auto-placed wrappers sometimes become huge */
.google-auto-placed{
  overflow: hidden !important;
}

/* =========================================
   Page / Layout
   ========================================= */
.event-page{
  background: #eef2f6;
  padding: 34px 0 80px;
  /* isolate layout from external injected elements */
  overflow-x: clip;
}
@supports not (overflow-x: clip){
  .event-page{ overflow-x: hidden; }
}

.event-container{
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;

  /* padding: stable (no vw). add sbw to right if you ever see right-shift on desktop */
  padding-left: 20px;
  padding-right: calc(20px + var(--sbw));
  box-sizing: border-box;

  display: grid;
  grid-template-columns: 1fr 255px;
  gap: 24px;

  /* critical in grid: prevent child overflow */
  min-width: 0;
}
@media (max-width: 960px){
  .event-container{
    grid-template-columns: 1fr;
    padding-left: 16px;
    padding-right: calc(16px + var(--sbw));
  }
}

/* main column safety (if ads inject inline margin/width) */
.event-main{
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* =========================================
   Hero
   ========================================= */
.event-hero{
  background:
    radial-gradient(1200px 420px at 50% 0%, rgba(201,162,77,.22), transparent 55%),
    linear-gradient(180deg, var(--navy), var(--navy2));
  color: #fff;
  text-align: center;
  padding: calc(42px + var(--header-h)) 0 27px;
  border-bottom: 1px solid rgba(255,255,255,.10);
  margin-top: 40px;
}

.event-hero--thin{
  padding: calc(32px + var(--header-h)) 0 22px;
}

/* remove vw dependency (ads/vignette breaks vw-based centering) */
.event-hero__inner{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.event-hero__title{
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: .10em;
  font-weight: 900;
  margin: 0;
}

.event-hero__lead{
  margin: 10px 0 0;
  opacity: .85;
  letter-spacing: .06em;
  font-weight: 700;
}

/* ===== Filter ===== */
.event-filter{
  margin-bottom: 16px;
  min-width: 0;
}
.event-filter__row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  min-width: 0;
}
.event-filter__chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ev-chip{
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  color: rgba(15,23,42,.85);
  border: 1px solid rgba(0,0,0,.10);
  text-decoration: none;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .08em;
}
.ev-chip:hover{
  background: rgba(10,95,255,.08);
  border-color: rgba(10,95,255,.22);
}
.ev-chip.is-active{
  background: #0b1630;
  color: #fff;
  border-color: rgba(255,255,255,.18);
}

/* Search */
.event-filter__search{
  flex: 1;
  min-width: 240px;
  max-width: 420px;
  position: relative;
  width: 100%;
}
.ev-search{
  width: 100%;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  padding: 0 12px;
  font-weight: 700;
  outline: none;
  box-sizing: border-box;
}
.ev-search:focus{
  border-color: rgba(10,95,255,.35);
  box-shadow: 0 0 0 3px rgba(10,95,255,.12);
}

/* 検索フォーム（SNS風） */
.ev-search{
  padding: 12px 44px 12px 16px;
  font-size: 14px;
  border-radius: 999px;
  border: none;
  outline: none;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  height: auto;
}
.ev-search::placeholder { color: #999; }
.event-filter__search::after{
  content: "🔍";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  opacity: .7;
}
.ev-search:focus{
  box-shadow: 0 6px 20px rgba(15,98,254,.25);
}

/* ===== Grid ===== */
.event-grid{
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}
@media (max-width: 960px){
  .event-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px){
  .event-grid{ grid-template-columns: 1fr; }
}

/* ===== Card ===== */
.event-card{
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.event-card__link{
  text-decoration: none;
  color: inherit;
  display: block;
}

/* 16:9 thumb */
.event-card__thumb{
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0b1630;
  overflow: hidden;
}
.event-card__thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform .35s ease;
}
.event-card:hover .event-card__thumb img{
  transform: scale(1.06);
}

/* badge（team_format） */
.event-badge{
  position: absolute;
  top: 10px;
  left: 10px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(11,22,48,.86);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .10em;
  backdrop-filter: blur(6px);
}

/* body */
.event-card__body{
  padding: 12px 12px 10px;
  flex: 1;
}
.event-card__meta{
  margin: 0 0 8px;
  font-size: 12px;
  color: rgba(15,23,42,.72);
  display: flex;
  align-items: center;
  gap: 10px;
}
.event-card__title{
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 900;
  color: #0b1630;
}
.event-card__venue{
  margin: 8px 0 0;
  font-size: 12px;
  color: rgba(15,23,42,.68);
  font-weight: 800;
  letter-spacing: .04em;
}

/* tag（mode/gender） */
.event-tag{
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.04);
  border: 1px solid rgba(0,0,0,.10);
  color: rgba(15,23,42,.84);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: .06em;
  white-space: nowrap;
}

/* mode tint */
.event-tag.is-team{ background: rgba(11,22,48,.08); border-color: rgba(11,22,48,.18); }
.event-tag.is-aa{ background: rgba(10,95,255,.10); border-color: rgba(10,95,255,.22); }
.event-tag.is-app{ background: rgba(0, 200, 140, .10); border-color: rgba(0, 200, 140, .28);}
.event-tag.is-mixed{ background: rgba(255,180,0,.10); border-color: rgba(255,180,0,.24); }

/* gender accent (軽い差分だけ) */
.event-tag.is-mag{ box-shadow: inset 0 0 0 1px rgba(10,95,255,.12); }
.event-tag.is-wag{ box-shadow: inset 0 0 0 1px rgba(255,64,160,.12); }
.event-tag.is-gmix{ box-shadow: inset 0 0 0 1px rgba(255,180,0,.14); }

/* small chips */
.event-card__subchips{
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.subchip{
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.03);
  border: 1px solid rgba(0,0,0,.08);
  color: rgba(15,23,42,.75);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: .06em;
}

/* actions */
.event-card__actions{
  padding: 12px;
  border-top: 1px solid rgba(0,0,0,.06);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ev-btn{
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .08em;
  border: 1px solid rgba(0,0,0,.12);
}
.ev-btn--primary{
  background: linear-gradient(135deg, #0A5FFF, #1FA2FF);
  color: #fff;
  border-color: rgba(10,95,255,.35);
}
.ev-btn--ghost{
  background: #fff;
  color: #0b1630;
}
.ev-btn.is-disabled{
  opacity: .45;
  pointer-events: none;
}

/* =========================
   Sidebar (shared)
   ========================= */
.event-side{
  position: sticky;
  top: calc(16px + var(--header-h));
  align-self: start;
  min-width: 0;
}

.side-box{
  background: #fff;
  border: 1px solid var(--line);
  padding: 16px 16px 10px;
  margin-bottom: 18px;
  min-width: 0;
}

.side-box h3{
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .18em;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(7,26,58,.15);
}

.side-box ul{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.side-box a{
  display: block;
  padding: 10px 10px;
  border-radius: 5px;
  text-decoration: none;
  color: rgba(17,24,39,.78);
  font-weight: 600;
  letter-spacing: .04em;
  border: 1px solid rgba(0,0,0,.06);
  background: rgba(0,0,0,.02);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
  font-size: 0.85rem;
}
.side-box a:hover{
  transform: translateY(-1px);
  background: rgba(7,26,58,.06);
  border-color: rgba(7,26,58,.14);
  color: rgba(17,24,39,.92);
}

/* Empty */
.event-empty{
  grid-column: 1 / -1;
  background: #fff;
  border: 1px dashed rgba(0,0,0,.20);
  border-radius: 14px;
  padding: 22px;
  color: rgba(15,23,42,.70);
  font-weight: 800;
}
.event-empty p{ margin: 0; }

/* 種目 2カラム */
.side-box__list--2col{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  font-feature-settings: "palt";
}
/* 「すべて」を横断表示 */
.side-box__full{ grid-column: 1 / -1; }

.side-box__list a{
  height: 43.53px;
  display: flex;
  align-items: center;
}

/* PCのみ適用 */
@media screen and (min-width: 1024px) {
  .event-name__long { font-size: 10px!important; }
}

