/*
 * Proposal C — lower page shell.
 *
 * The TOP page keeps its approved three-region shell (left visual /
 * 390px centre / right SITE MENU). Every other page is an ordinary
 * flexible site: a normal header, a main column that uses the viewport,
 * and a full-width footer. Nothing here touches `.shell-c--top`.
 */

/* ------------------------------------------------------- page shell */

.shell-c--page {
  display: block;
  width: 100%;
}

.shell-c--page .c-center {
  display: block;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  background: var(--color-base);
}

/* Readable measure for prose; wider blocks opt out with --page-width. */
.shell-c--page .c-center > main {
  display: block;
  width: 100%;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.shell-c--page .c-center > main > * {
  width: min(100%, var(--page-width, 46rem));
  margin-inline: auto;
}

/* Lists, cards, tables and galleries may use a wider measure. */
.shell-c--page .c-page-wide,
.shell-c--page .team-list,
.shell-c--page .news-list,
.shell-c--page .c-faq-list {
  --page-width: 68rem;
}

/* -------------------------------------------------- page header (PC) */

.p-header {
  position: sticky;
  z-index: 30;
  inset-block-start: 0;
  width: 100%;
  background: color-mix(in srgb, var(--color-base) 96%, transparent);
  border-block-end: 1px solid var(--color-line);
  backdrop-filter: blur(6px);
}

.p-header__inner {
  display: flex;
  gap: clamp(.75rem, 2vw, 1.75rem);
  align-items: center;
  width: min(100%, 84rem);
  margin-inline: auto;
  padding: .7rem clamp(1rem, 4vw, 2.5rem);
}

/*
 * Shrinkable, not fixed. A brand that refuses to give up width pushes the
 * nav and the CTA out of the bar rather than making room for them.
 */
.p-header__brand {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
}

.p-header__brand a {
  display: flex;
  gap: .55rem;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.p-header__nav {
  flex: 1;
  min-width: 0;
}

.p-header__cta {
  display: flex;
  flex: none;
  gap: .4rem;
  align-items: center;
  min-height: 2.75rem;
  padding: .6rem 1rem;
  color: var(--color-ink);
  background: var(--color-accent);
  border: 1px solid var(--color-accent-line);
  border-radius: .8rem;
  font-size: .8125rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.p-header__cta.is-unavailable {
  color: var(--color-muted);
  background: color-mix(in srgb, var(--color-line) 40%, var(--color-base));
  border-color: var(--color-line);
}

/* The horizontal header nav drops the grouping and the index numbers. */
.p-header .c-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 .35rem;
  justify-content: flex-end;
}

.p-header .c-nav__group-title,
.p-header .c-nav__number,
.p-header .c-nav__arrow,
.p-header .c-nav__en {
  display: none;
}

.p-header .c-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 .15rem;
}

.p-header .c-nav__link {
  display: block;
  min-height: 0;
  padding: .45rem .6rem;
  border-radius: .55rem;
}

.p-header .c-nav__label {
  font-size: .8125rem;
  white-space: nowrap;
}

/* Below the desktop breakpoint the sticky mobile header takes over. */
@media (max-width: 68.6875rem) {
  .p-header {
    display: none;
  }
}

/*
 * On a lower page the compact header is shown from the start rather than on
 * scroll, because it carries the only navigation there is at this width. It
 * is fixed, so the column below has to clear its height.
 */
@media (max-width: 68.6875rem) {
  .has-fixed-header .shell-c--page .c-center {
    padding-block-start: 4rem;
  }
}

/* The TOP-only mobile chrome must not appear on lower pages at desktop. */
@media (min-width: 68.75rem) {
  .shell-c--page .c-header,
  .shell-c--page .c-menu-button,
  .shell-c--page .c-mobile-menu,
  .shell-c--page .c-menu-backdrop {
    display: none !important;
  }
}

/* ------------------------------------------------------- page footer */

.c-footer__inner {
  width: min(100%, 84rem);
  padding: 2.5rem clamp(1rem, 4vw, 2.5rem) 2rem;
}

/*
 * Three columns once there is room: organiser, sitemap, related links.
 * Scoped to the lower pages: the TOP footer keeps the three blocks stacked,
 * while still spanning the full width.
 */
@media (min-width: 48rem) {
  .shell-c--page .c-footer__columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.5rem 2rem;
  }

  .shell-c--page .c-footer__base {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem 2rem;
  }
}

/* --------------------------------------------------------- page body */

/*
 * The other lower templates (contact, teams, news, faq, singles, 404) share
 * `.c-section` + `.c-heading` + `.prose.entry-content`, so they inherit the
 * same page treatment without rewriting each template.
 */
.shell-c--page .c-section {
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
}

.shell-c--page .c-page-intro {
  padding-block-start: clamp(2rem, 5vw, 3.25rem);
}

.shell-c--page .c-heading .c-overline {
  color: var(--color-muted);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .16em;
}

.shell-c--page .c-heading h1 {
  margin: .4rem 0 0;
  font-size: clamp(1.35rem, 1rem + 1.6vw, 2.1rem);
  line-height: 1.35;
}

.shell-c--page .page-header__lead {
  margin: .85rem 0 0;
  color: var(--color-muted);
  font-size: clamp(.875rem, .82rem + .2vw, 1rem);
  line-height: 1.85;
}

.shell-c--page .prose.entry-content {
  margin-block-start: clamp(1.25rem, 3vw, 2rem);
}

/* The lower-page body shares the rules written for .p-page__body. */
.shell-c--page .prose.entry-content > * + * { margin-block-start: 1.1rem; }

.shell-c--page .prose.entry-content h2 {
  margin-block-start: clamp(2rem, 4vw, 2.75rem);
  padding-block-end: .5rem;
  border-block-end: 2px solid var(--color-brand);
  font-size: clamp(1.1rem, .95rem + .7vw, 1.5rem);
  line-height: 1.4;
}

.shell-c--page .prose.entry-content h3 {
  margin-block-start: 1.75rem;
  font-size: clamp(1rem, .92rem + .35vw, 1.2rem);
}

.shell-c--page .prose.entry-content p,
.shell-c--page .prose.entry-content li {
  font-size: clamp(.875rem, .84rem + .18vw, .9375rem);
  line-height: 1.9;
}

/* ---------------------------------------------------------- breadcrumbs */

/*
 * The Proposal C markup is `.c-breadcrumbs`, but the breadcrumb rules stayed
 * behind in main.css under the unprefixed `.breadcrumbs`, so nothing matched
 * and the trail rendered as a default numbered `<ol>` stacked vertically.
 */
.c-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem .35rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: .75rem;
  line-height: 1.6;
}

.c-breadcrumbs li {
  display: flex;
  gap: .35rem;
  align-items: baseline;
  min-width: 0;
}

.c-breadcrumbs li + li::before {
  color: var(--color-muted);
  content: "＞";
}

.c-breadcrumbs a {
  color: var(--color-muted);
  text-decoration: none;
}

.c-breadcrumbs a:hover,
.c-breadcrumbs a:focus-visible {
  color: var(--color-brand-deep);
  text-decoration: underline;
}

/* A long entry title has to wrap here, or it reopens the UI-02 side scroll. */
.c-breadcrumbs [aria-current="page"] {
  color: var(--color-ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.p-page__header {
  padding-block: clamp(2rem, 5vw, 3.25rem) clamp(1.25rem, 3vw, 2rem);
}

.p-page__eyebrow {
  margin: 0 0 .4rem;
  color: var(--color-muted);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .16em;
}

.p-page__title {
  margin: 0;
  font-size: clamp(1.35rem, 1rem + 1.6vw, 2.1rem);
  line-height: 1.35;
}

.p-page__lead {
  margin: .85rem 0 0;
  color: var(--color-muted);
  font-size: clamp(.875rem, .82rem + .2vw, 1rem);
  line-height: 1.85;
}

.p-page__body {
  padding-block-end: clamp(2.5rem, 6vw, 4rem);
}

/* Body typography for Custom HTML + standard blocks written in wp-admin. */
.p-page__body > * + * {
  margin-block-start: 1.1rem;
}

.p-page__body h2 {
  margin-block-start: clamp(2rem, 4vw, 2.75rem);
  padding-block-end: .5rem;
  border-block-end: 2px solid var(--color-brand);
  font-size: clamp(1.1rem, .95rem + .7vw, 1.5rem);
  line-height: 1.4;
}

.p-page__body h3 {
  margin-block-start: 1.75rem;
  font-size: clamp(1rem, .92rem + .35vw, 1.2rem);
  line-height: 1.45;
}

.p-page__body p,
.p-page__body li {
  font-size: clamp(.875rem, .84rem + .18vw, .9375rem);
  line-height: 1.9;
}

.p-page__body ul,
.p-page__body ol {
  padding-inline-start: 1.4rem;
}

.p-page__body li + li {
  margin-block-start: .4rem;
}

.p-page__body a {
  color: var(--color-brand-deep);
  text-underline-offset: .18em;
}

.p-page__body strong {
  font-weight: 700;
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--color-accent) 55%, transparent) 0);
}

.p-page__body img {
  max-width: 100%;
  height: auto;
  border-radius: .8rem;
}

.p-page__body figure {
  margin-inline: 0;
}

.p-page__body figcaption {
  margin-block-start: .5rem;
  color: var(--color-muted);
  font-size: .75rem;
  line-height: 1.6;
}

/* Tables never widen the page; only the table itself scrolls. */
.p-page__body .wp-block-table,
.p-page__body .p-table {
  overflow-x: auto;
}

.p-page__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.p-page__body th,
.p-page__body td {
  padding: .7rem .85rem;
  border: 1px solid var(--color-line);
  text-align: start;
  vertical-align: top;
}

.p-page__body th {
  width: 30%;
  background: color-mix(in srgb, var(--color-brand) 7%, var(--color-base));
  font-weight: 700;
  white-space: nowrap;
}

/* Shared helper classes usable from Custom HTML blocks. */
.p-lead {
  color: var(--color-muted);
  font-size: 1rem !important;
  line-height: 1.9;
}

.p-note {
  padding: 1rem 1.15rem;
  background: color-mix(in srgb, var(--color-brand) 7%, var(--color-base));
  border-radius: .8rem;
  font-size: .8125rem !important;
  line-height: 1.8;
}

.p-notice {
  padding: 1rem 1.15rem;
  background: color-mix(in srgb, var(--color-accent) 18%, var(--color-base));
  border: 1px solid var(--color-accent-line);
  border-radius: .8rem;
  font-size: .8125rem !important;
  line-height: 1.8;
}

.p-muted {
  color: var(--color-muted);
  font-size: .8125rem !important;
}

.p-accent {
  color: var(--color-brand-deep);
  font-weight: 700;
}

.p-cta {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  min-height: 3rem;
  padding: .8rem 1.5rem;
  color: var(--color-ink);
  background: var(--color-accent);
  border: 1px solid var(--color-accent-line);
  border-radius: .9rem;
  font-weight: 700;
  text-decoration: none;
}

.p-cta--ghost {
  color: var(--color-ink);
  background: var(--color-base);
  border-color: var(--color-line);
}

/* Cards used by 応募規約 / コンテストについて style sections. */
.p-cards {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 40rem) {
  .p-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.p-card {
  padding: 1.15rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: .9rem;
}

.p-card h3 {
  margin-block-start: 0 !important;
}

/* ------------------------------------------------ entry page CTA block */

.p-entry-cta {
  margin-block-start: clamp(2rem, 5vw, 3rem);
  padding: clamp(1.25rem, 3vw, 2rem);
  color: var(--color-base);
  background: var(--color-ink);
  border-radius: 1.1rem;
}

.p-entry-cta__eyebrow {
  margin: 0 0 .5rem;
  color: color-mix(in srgb, var(--color-accent) 92%, transparent);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .16em;
}

.p-entry-cta__title {
  margin: 0 0 .6rem;
  font-size: clamp(1.05rem, .95rem + .5vw, 1.35rem);
  line-height: 1.45;
}

.p-entry-cta__text {
  margin: 0 0 1.1rem;
  color: color-mix(in srgb, var(--color-base) 78%, transparent);
  font-size: .8125rem;
  line-height: 1.8;
}

.p-entry-cta .p-cta {
  min-height: 3.25rem;
}

/*
 * The state pill was drawn for the pale page; this card is dark. It only
 * needs breathing room, except 企画中止, which is dark-on-dark here and is
 * flipped back.
 */
.p-entry-cta .status-label {
  margin-block-end: .8rem;
}

.p-entry-cta .status-label--cancelled {
  color: var(--color-ink);
  background: var(--color-base);
}

/* The agreement that gates the application button. */
.p-entry-cta__consent {
  margin: 0 0 1rem;
}

.p-entry-cta__consent label {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  cursor: pointer;
  font-size: .875rem;
  line-height: 1.7;
}

.p-entry-cta__consent input {
  flex: none;
  /* Lines up with the first line of the label rather than the block. */
  margin-block-start: .25rem;
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--color-accent);
}

.p-entry-cta__consent a {
  /* Underlined, because the colour is the same as the sentence around it. */
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: .2em;
}

/* Full width, so the one action on the page is unmissable. */
.p-cta--wide {
  display: flex;
  justify-content: center;
  width: 100%;
  text-align: center;
}

/*
 * Waiting on the agreement. The link keeps its shape and stays readable —
 * it is not unavailable, it is simply not yet unlocked — while pointer and
 * keyboard activation are both refused (the href is removed in script).
 */
.p-cta.is-disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: saturate(.5);
}

/* Body-level route out of a page: 応募規約 from about, 個人情報 from about-us. */
.p-page__entry-link {
  margin: clamp(1.75rem, 4vw, 2.5rem) 0 0;
}

.p-entry-cta__unset {
  margin: 0;
  padding: .9rem 1rem;
  background: color-mix(in srgb, var(--color-base) 12%, transparent);
  border-radius: .7rem;
  font-size: .8125rem;
  line-height: 1.7;
}

@media (prefers-reduced-motion: reduce) {
  .p-header {
    backdrop-filter: none;
  }
}

/* The application CTA needs room before the footer starts. */
.p-entry-cta {
  margin-block-end: clamp(3rem, 8vw, 6rem);
}

/* PC header on the ink ground, matching the footer. */
.p-header {
  color: #fff;
  background: var(--color-ink);
  border-block-end: 1px solid color-mix(in srgb, #fff 18%, transparent);
}

.p-header__brand a,
.p-header .c-nav__link {
  color: #fff;
}

.p-header .c-nav__link:hover,
.p-header .c-nav__link[aria-current="page"] {
  background: color-mix(in srgb, #fff 12%, transparent);
}

/* --------------------------------------------------- related NEWS entries */

.p-related {
  margin-block: clamp(2rem, 5vw, 3rem) 0;
}

.p-related__title {
  margin: 0 0 1rem;
  font-size: clamp(1rem, .95rem + .2vw, 1.125rem);
}

.p-related__list {
  display: grid;
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-related__item a {
  display: grid;
  gap: .375rem;
  padding: 1rem 1.25rem;
  color: var(--color-ink);
  background: var(--color-base);
  border: 1px solid color-mix(in srgb, var(--color-ink) 10%, transparent);
  border-radius: 1.25rem;
  text-decoration: none;
}

.p-related__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  align-items: baseline;
  color: var(--color-muted);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
}

.p-related__name {
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------ previous and next */

.post-nav {
  display: grid;
  gap: .75rem;
  margin-block: clamp(2rem, 5vw, 3rem) 0;
}

@media (min-width: 40rem) {
  .post-nav {
    grid-template-columns: 1fr 1fr;
  }
}

.post-nav a {
  display: grid;
  gap: .35rem;
  padding: 1rem 1.25rem;
  color: var(--color-ink);
  background: var(--color-base);
  border: 1px solid color-mix(in srgb, var(--color-ink) 10%, transparent);
  border-radius: 1.25rem;
  font-weight: 700;
  line-height: 1.6;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.post-nav a span {
  color: var(--color-muted);
  font-size: .75rem;
  letter-spacing: .06em;
}

/*
 * The direction reads as an arrow. The words are still in the page for
 * screen readers, so this is a change of appearance only.
 */
.post-nav a .post-nav__dir {
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: 0;
}

/* ------------------------------------------------------------ pagination */

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin-block-start: 2rem;
}

.pagination .page-numbers {
  display: inline-flex;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: .5rem .9rem;
  align-items: center;
  justify-content: center;
  color: var(--color-ink);
  background: var(--color-base);
  border: 1px solid color-mix(in srgb, var(--color-ink) 30%, transparent);
  border-radius: .75rem;
  font-size: .875rem;
  font-weight: 700;
  text-decoration: none;
}

.pagination .page-numbers.current {
  color: var(--color-base);
  background: var(--color-ink);
  border-color: var(--color-ink);
}

.pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
}

/* PC lower-page navigation on one row, all items visible. */
@media (min-width: 68.75rem) {
  .p-header__nav .c-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: .25rem;
    align-items: center;
  }

  .p-header__nav .c-nav__group {
    display: contents;
  }

  .p-header__nav .c-nav__group-title,
  .p-header__nav .c-nav__number,
  .p-header__nav .c-nav__en,
  .p-header__nav .c-nav__arrow {
    display: none;
  }

  .p-header__nav .c-nav__list {
    display: contents;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .p-header__nav .c-nav__link {
    display: inline-flex;
    align-items: center;
    padding: .4rem .55rem;
    border-radius: .5rem;
    font-size: clamp(.6875rem, .55rem + .28vw, .8125rem);
    line-height: 1.3;
    white-space: nowrap;
  }
}

/* Every article card shows its date, on the archive and in related lists. */
.news-item__meta time,
.p-related__meta time {
  display: inline-block;
}
