/*
Theme Name: My Custom Theme
Theme URI: https://example.com/my-custom-theme
Author: Your Name
Author URI: https://example.com
Description: A modern, responsive, block-editor-ready WordPress theme.
Version: 1.0.0
Tested up to: 6.9
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: my-custom-theme
*/

/* =========================================================
   1. CSS Reset / Base
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--site-color-main, #111827);
  background-color: var(--site-color-bg, #ffffff);
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

/* =========================================================
   2. Layout Helpers
   ========================================================= */

.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header,
.site-footer {
  padding: 1.5rem 0;
  background-color: var(--site-color-main, #0f172a);
  color: var(--site-color-main-text, #f9fafb);
}

.site-main {
  flex: 1 0 auto;
  padding: 2rem 0;
}

.site-inner {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .site-inner {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (min-width: 1024px) {
  .site-inner {
    max-width: 90rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* =========================================================
   3. Typography
   ========================================================= */

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.75em;
  font-weight: 700;
  line-height: 1.25;
  color: #0f172a;
}

p {
  margin: 0 0 1.25em;
}

ul,
ol {
  margin: 0 0 1.25em 1.5em;
  padding: 0;
}

blockquote {
  margin: 0 0 1.5em;
  padding: 1rem 1.5rem;
  border-left: 4px solid #2563eb;
  background-color: #eff6ff;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: #0f172a;
  color: #e5e7eb;
}

pre {
  padding: 1rem;
  overflow: auto;
}

/* =========================================================
   4. Forms & Buttons
   ========================================================= */

button,
input[type="submit"],
.button,
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background-color: #2563eb;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

button:hover,
input[type="submit"]:hover,
.button:hover,
.wp-block-button__link:hover {
  background-color: #1d4ed8;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.15);
}

button:focus-visible,
input[type="submit"]:focus-visible,
.button:focus-visible,
.wp-block-button__link:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
  width: 100%;
  max-width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background-color: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
}

/* =========================================================
   5. WordPress Core Alignment Classes
   ========================================================= */

.alignnone {
  margin: 0 0 1.5em;
}

.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5em;
}

.alignleft {
  float: left;
  margin: 0 1.5em 1.5em 0;
}

.alignright {
  float: right;
  margin: 0 0 1.5em 1.5em;
}

.wp-caption {
  max-width: 100%;
  padding: 0.5rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
  text-align: center;
}

.wp-caption-text {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: #6b7280;
}

/* Clearfix for floated elements */
.clear::before,
.clear::after,
.entry-content::before,
.entry-content::after {
  content: "";
  display: table;
  table-layout: fixed;
}

.clear::after,
.entry-content::after {
  clear: both;
}

/* =========================================================
   6. Block Editor: Global
   ========================================================= */

/* コンテンツ領域の最大幅と余白（フロント側） */
.entry-content,
.wp-block-post-content {
  max-width: 720px;
  margin: 0 auto;
}

.entry-content > *:first-child,
.wp-block-post-content > *:first-child {
  margin-top: 0;
}

.entry-content > *:last-child,
.wp-block-post-content > *:last-child {
  margin-bottom: 0;
}

/* ブロック共通 */
.wp-block {
  max-width: 100%;
}

.wp-block[data-align="wide"],
.alignwide {
  max-width: 1200px;
}

.wp-block[data-align="full"],
.alignfull {
  max-width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
}

/* =========================================================
   7. Block Editor: 各種ブロック
   ========================================================= */

/* 見出しブロック */
.wp-block-heading,
.wp-block-post-title {
  font-weight: 700;
  line-height: 1.2;
}

/* 段落ブロック */
.wp-block-paragraph {
  margin: 0 0 1.25em;
}

/* 画像ブロック */
.wp-block-image {
  margin: 0 0 1.5em;
}

.wp-block-image img {
  border-radius: 0.75rem;
}

/* ボタンブロック（上の共通ボタンスタイルを継承） */
.wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* 引用ブロック */
.wp-block-quote {
  border-left: 4px solid #2563eb;
  padding-left: 1.5rem;
  color: #111827;
}

.wp-block-quote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 1rem;
  color: #6b7280;
}

/* ギャラリーブロック */
.wp-block-gallery {
  gap: 0.75rem;
}

.wp-block-gallery .blocks-gallery-item {
  margin: 0;
}

/* カラムブロック */
.wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.wp-block-column {
  flex: 1 1 0;
  min-width: 0;
}

/* テーブルブロック */
.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
}

.wp-block-table th,
.wp-block-table td {
  padding: 0.6rem 0.75rem;
  border: 1px solid #e5e7eb;
}

.wp-block-table thead {
  background-color: #f3f4f6;
}

/* =========================================================
   8. Responsive Design
   ========================================================= */

@media (max-width: 768px) {
  .site-header,
  .site-footer {
    padding: 1.25rem 1rem;
  }

  .site-main {
    padding: 1.5rem 1rem;
  }

  .entry-content,
  .wp-block-post-content {
    max-width: 100%;
  }

  .alignleft,
  .alignright {
    float: none;
    margin: 0 0 1.5em;
  }

  .wp-block-columns {
    flex-direction: column;
  }
}

/* 超小型端末向けの微調整 */
@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.85rem;
  }

  h3 {
    font-size: 1.55rem;
  }
}

