/*
Theme Name: DIE Corporate
Description: ディーアイイー株式会社のコーポレートサイト用テーマ。トップ・事業紹介・会社概要・お知らせ・お問い合わせ・プライバシーポリシーを、有効化時に自動で作成します。
Version: 1.0.1
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: die-corporate
*/

/* ------------------------------------------------------------
   基本の色と文字
   ノートの紙（罫線と左の赤い余白線）をモチーフにしています
------------------------------------------------------------ */
:root {
  --ink: #1e2a4f;        /* 見出し・リンク・ボタン：インクの藍 */
  --ink-hover: #2f3f73;
  --text: #1f2430;
  --muted: #5b6375;
  --paper: #f6f8fb;      /* 罫線のある紙 */
  --white: #ffffff;
  --rule: #d6deeb;       /* 罫線 */
  --margin-line: #d65a5a;/* ノートの余白線（ヒーローのみ） */
  --line: 2.25rem;       /* 罫線の間隔 */
  --wrap: 68rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --serif: "Shippori Mincho B1", "Yu Mincho", "YuMincho", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.85;
  letter-spacing: .02em;
}

img { max-width: 100%; height: auto; }

a { color: var(--ink); text-underline-offset: .2em; }
a:hover { color: var(--ink-hover); }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; top: .5rem; left: .5rem; z-index: 100; width: auto; height: auto; clip: auto;
  background: var(--white); padding: .5rem 1rem;
}

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

h1, h2, h3, .hero-lead, .entry-content p { word-break: auto-phrase; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); line-height: 1.5; letter-spacing: .04em; }
h1 { font-size: clamp(1.75rem, 3.2vw, 2.25rem); margin: 0 0 1.5rem; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); margin: 3.5rem 0 1.25rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 .75rem; }
p { margin: 0 0 1.25rem; }

/* ------------------------------------------------------------
   ヘッダー
------------------------------------------------------------ */
.site-header { border-bottom: 1px solid var(--rule); background: var(--white); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; }
.site-title { margin: 0; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; letter-spacing: .08em; }
.site-title a { color: var(--ink); text-decoration: none; }
.site-title small { display: block; font-family: var(--sans); font-size: .7rem; font-weight: 400; color: var(--muted); letter-spacing: .04em; }

.nav-toggle {
  display: none; border: 1px solid var(--rule); background: var(--white); color: var(--ink);
  font: inherit; font-size: .875rem; padding: .4rem .9rem; border-radius: 4px; cursor: pointer;
}
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.75rem; }
.main-nav a { color: var(--text); text-decoration: none; font-size: .925rem; padding: .25rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { color: var(--ink); border-bottom-color: var(--ink); }

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 4.5rem; background: var(--white); border-bottom: 1px solid var(--rule); z-index: 20; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; padding: .5rem var(--gutter) 1rem; }
  .main-nav li { border-top: 1px solid var(--rule); }
  .main-nav a { display: block; padding: .85rem 0; border: 0; }
  .site-header { position: relative; }
}

/* ------------------------------------------------------------
   トップのヒーロー：罫線ノートに書かれた一文
------------------------------------------------------------ */
.hero {
  position: relative;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px), var(--rule) var(--line));
  background-position: 0 calc(var(--line) * .62);
  padding: calc(var(--line) * 3) 0 calc(var(--line) * 2.5);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; top: 0; bottom: 0;
  left: max(calc((100% - var(--wrap)) / 2 - 1.75rem), .75rem);
  width: 1px; background: var(--margin-line); opacity: .75;
}
.hero-title {
  margin: 0 0 var(--line);
  font-size: clamp(1.9rem, 5.2vw, 3.6rem);
  line-height: calc(var(--line) * 2);
  letter-spacing: .06em;
  max-width: 16em;
}
@media (max-width: 760px) { .hero-title { line-height: var(--line); font-size: clamp(1.5rem, 6.4vw, 2rem); } }
.hero-lead { max-width: 34em; line-height: var(--line); margin: 0 0 var(--line); color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; }

/* ------------------------------------------------------------
   ボタン
------------------------------------------------------------ */
.button,
.wp-block-button__link,
.die-form button[type="submit"] {
  display: inline-block; background: var(--ink); color: var(--white); text-decoration: none;
  font-family: var(--sans); font-size: .95rem; font-weight: 500; letter-spacing: .04em;
  padding: .8rem 1.6rem; border: 0; border-radius: 4px; cursor: pointer; line-height: 1.5;
}
.button:hover,
.wp-block-button__link:hover,
.die-form button[type="submit"]:hover { background: var(--ink-hover); color: var(--white); }
.button--quiet { background: transparent; color: var(--ink); padding-inline: 0; text-decoration: underline; }
.button--quiet:hover { background: transparent; color: var(--ink-hover); }

/* ------------------------------------------------------------
   本文エリア
------------------------------------------------------------ */
.site-main { padding: 3.5rem 0 5rem; }
.home .site-main { padding-top: 0; padding-bottom: 0; }
.page-header { padding: 3rem 0 2rem; border-bottom: 1px solid var(--rule); background: var(--paper); }
.page-header h1 { margin: 0; }
.entry-content > * { max-width: 46rem; }
.entry-content > .die-biz-list,
.entry-content > .die-map,
.entry-content > .wp-block-html { max-width: none; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content ul,
.entry-content ol { padding-left: 1.4em; margin: 0 0 1.25rem; }
.entry-content li { margin-bottom: .35rem; }

.section { padding: 4rem 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section > .wrap > h2:first-child { margin-top: 0; }

/* ------------------------------------------------------------
   事業の一覧（左に事業名、右に説明の2段組）
------------------------------------------------------------ */
.die-biz-list { margin: 0; }
.die-biz {
  display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr; gap: .5rem 2.5rem;
  padding: 2rem 0; border-top: 1px solid var(--rule);
}
.die-biz:last-child { border-bottom: 1px solid var(--rule); }
.die-biz > h3 { margin: 0; font-size: 1.15rem; }
.die-biz > h3 small { display: block; font-family: var(--sans); font-weight: 400; font-size: .8rem; color: var(--muted); letter-spacing: .02em; margin-top: .25rem; }
.die-biz > .die-biz-body > *:last-child { margin-bottom: 0; }
.die-biz.is-featured { background: var(--paper); margin-inline: -1.5rem; padding-inline: 1.5rem; border-top: 2px solid var(--ink); }
.die-biz-list + p { margin-top: 1.5rem; }
@media (max-width: 760px) { .die-biz.is-featured { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); } }
.die-biz.is-featured > h3 { font-size: 1.4rem; }
@media (max-width: 760px) {
  .die-biz { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------
   表（会社概要など）
------------------------------------------------------------ */
.entry-content table,
.wp-block-table table { width: 100%; border-collapse: collapse; margin: 0 0 2rem; font-size: .95rem; }
.wp-block-table { margin: 0; }
.entry-content th,
.entry-content td { text-align: left; vertical-align: top; padding: 1rem .75rem; border: 0; border-bottom: 1px solid var(--rule); }
.entry-content tr:first-child th,
.entry-content tr:first-child td { border-top: 1px solid var(--ink); }
.entry-content td:first-child,
.entry-content th:first-child { width: 9rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
@media (max-width: 560px) {
  .entry-content tr { display: block; border-bottom: 1px solid var(--rule); padding: .75rem 0; }
  .entry-content td { display: block; border: 0 !important; padding: .1rem 0; }
}
.die-map iframe { width: 100%; height: 320px; border: 0; }

/* ------------------------------------------------------------
   お知らせ
------------------------------------------------------------ */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.news-list li:first-child { border-top: 1px solid var(--rule); }
.news-list time { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.news-list a { text-decoration: none; }
.news-list a:hover { text-decoration: underline; }
@media (max-width: 560px) { .news-list li { grid-template-columns: 1fr; gap: .1rem; } }
.news-empty { color: var(--muted); }
.entry-meta { color: var(--muted); font-size: .9rem; margin: -.75rem 0 2rem; }
.pagination { margin-top: 2.5rem; display: flex; gap: 1rem; }

/* ------------------------------------------------------------
   お問い合わせフォーム
------------------------------------------------------------ */
.die-form { max-width: 40rem; }
.die-form .field { margin-bottom: 1.5rem; }
.die-form label,
.die-form legend { display: block; font-weight: 500; margin-bottom: .4rem; padding: 0; }
.die-form .req { color: #b42318; font-size: .8rem; margin-left: .4rem; font-weight: 400; }
.die-form input[type="text"],
.die-form input[type="email"],
.die-form input[type="tel"],
.die-form textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--white);
  border: 1px solid #b8c3d6; border-radius: 4px; padding: .7rem .8rem;
}
.die-form textarea { min-height: 10rem; resize: vertical; }
.die-form fieldset { border: 0; margin: 0 0 1.5rem; padding: 0; }
.die-form .choices { display: grid; gap: .4rem; }
.die-form .choices label { font-weight: 400; display: flex; gap: .5rem; align-items: baseline; margin: 0; }
.die-form .hint { color: var(--muted); font-size: .875rem; margin: .35rem 0 1.5rem; }
.die-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.die-notice { padding: 1rem 1.25rem; border-left: 4px solid var(--ink); background: var(--paper); margin-bottom: 2rem; }
.die-notice.is-error { border-left-color: #b42318; background: #fdf3f2; }

/* ------------------------------------------------------------
   お問い合わせへの誘導とフッター
------------------------------------------------------------ */
.contact-band { background: var(--ink); color: var(--white); padding: 3.5rem 0; }
.contact-band h2 { color: var(--white); margin: 0 0 .75rem; }
.contact-band p { margin: 0 0 1.5rem; color: #d9def0; }
.contact-band .button { background: var(--white); color: var(--ink); }
.contact-band .button:hover { background: #e6ebf5; color: var(--ink); }

.site-footer { background: var(--paper); border-top: 1px solid var(--rule); padding: 3rem 0 2rem; font-size: .9rem; color: var(--muted); }
.site-footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 2rem; }
.site-footer .footer-name { font-family: var(--serif); color: var(--ink); font-size: 1.05rem; font-weight: 600; margin: 0 0 .5rem; }
.site-footer address { font-style: normal; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.site-footer a { color: var(--muted); }
.site-footer .copyright { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 1.5rem; margin: 0; font-size: .8rem; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
