/*
Theme Name: ex-contest
Theme URI:
Author:
Description: A lightweight, customizable classic theme for the ex-contest site.
Version: 1.0.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ex-contest
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  --ex-color-text: #1f2933;
  --ex-color-muted: #637083;
  --ex-color-accent: #0b9fc4;
  --ex-color-accent-dark: #0068a9;
  --ex-color-border: #d9e0e5;
  --ex-color-surface: #eef7fb;
  --ex-color-white: #fff;
  --ex-content-width: 72rem;
  --ex-reading-width: 48rem;
  --ex-spacing: 1.5rem;
  --ex-radius: 0.25rem;
  --ex-font-body: "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --ex-font-heading: "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  opacity: 1;
  color: var(--ex-color-text);
  background: var(--ex-color-white);
  font-family: var(--ex-font-body);
  font-size: 1rem;
  line-height: 1.8;
}

a {
  color: var(--ex-color-accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover, a:focus {
  color: var(--ex-color-accent);
}

img {
  max-width: 100%;
  height: auto;
}

button, input, textarea, select {
  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;
}

.screen-reader-text:focus {
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100000;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  color: var(--ex-color-white);
  background: var(--ex-color-text);
}

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header, .site-footer {
  border-color: var(--ex-color-border);
}

.site-header {
  border-bottom: 1px solid var(--ex-color-border);
}

.site-branding, .main-navigation, .site-main, .site-footer__inner {
  width: min(100% - 3rem, var(--ex-content-width));
  margin-inline: auto;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.25rem 0;
}

.site-title {
  margin: 0;
  font-family: var(--ex-font-heading);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.2;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-description {
  margin: 0.35rem 0 0;
  color: var(--ex-color-muted);
  font-size: 0.875rem;
}

.main-navigation ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-navigation a {
  text-decoration: none;
}

.menu-toggle {
  display: none;
}

.site-main {
  flex: 1;
}

.ex-contest-vote-page .site-main {
  width: 100%;
  max-width: none;
}

.ex-contest-vote-page .content-area {
  width: 100%;
  max-width: none;
}

.content-area {
  max-width: var(--ex-reading-width);
}

.home .content-area {
  max-width: none;
}

.entry {
  margin-bottom: 4rem;
}

.entry-header {
  margin-bottom: 1.5rem;
}

/* Keep content headers in the normal document flow. The shared contest
   stylesheet fixes the site navigation with a broad `header` selector. */
.site-main header,
.site-main .entry-header {
  position: static;
  display: block;
  width: auto;
  padding: 0;
  background: transparent;
  inset: auto;
  z-index: auto;
}

.entry-title {
  margin: 0;
  font-family: var(--ex-font-heading);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.3;
}

.entry-title a {
  color: inherit;
  text-decoration: none;
}

.entry-meta, .entry-footer {
  color: var(--ex-color-muted);
  font-size: 0.875rem;
}

.entry-content>* {
  margin-block: 1.5rem;
}

.entry-content> :first-child {
  margin-top: 0;
}

.entry-content> :last-child {
  margin-bottom: 0;
}

.wp-block-image, figure {
  margin-inline: 0;
}

.page-links {
  clear: both;
  margin: 1.5rem 0;
}

.navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--ex-color-border);
}

.site-footer {
  margin-top: auto;
  background: var(--ex-color-surface);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  padding-block: 2rem;
  text-align: center;
}

.widget-area {
  padding-top: 2rem;
}

.widget {
  margin-bottom: 2rem;
}

.widget-title {
  margin-top: 0;
  font-size: 1.1rem;
}

.widget ul {
  padding-left: 1.2rem;
}

.comment-list {
  padding-left: 0;
  list-style: none;
}

.comment-list .comment {
  margin-block: 2rem;
  padding: 1rem;
  border: 1px solid var(--ex-color-border);
  border-radius: var(--ex-radius);
}

.comment-meta {
  color: var(--ex-color-muted);
  font-size: 0.875rem;
}

input, textarea, select {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ex-color-border);
  border-radius: var(--ex-radius);
}

button, input[type="submit"] {
  width: auto;
  padding: 0.65rem 1rem;
  color: var(--ex-color-white);
  background: var(--ex-color-accent-dark);
  border: 0;
  border-radius: var(--ex-radius);
  cursor: pointer;
}

button:hover, input[type="submit"]:hover {
  background: var(--ex-color-accent);
}

@media (max-width: 48rem) {
  .site-branding, .main-navigation, .site-main, .site-footer__inner {
    width: min(100% - 2rem, var(--ex-content-width));
  }

  .site-header__inner, .site-footer__inner {
    display: block;
  }

  .menu-toggle.is-visible {
    display: block;
    margin-top: 1rem;
  }

  .main-navigation {
    display: none;
    padding-bottom: 1rem;
  }

  .main-navigation.is-open {
    display: block;
  }

  .main-navigation ul {
    display: block;
  }

  .main-navigation li+li {
    margin-top: 0.5rem;
  }

  .main-navigation ul {
    gap: 0.5rem 1rem;
  }

  .site-footer__inner>*+* {
    margin-top: 1.5rem;
  }
}
