/*
Theme Name: PrompTemp
Description: Generative AI prompt sharing platform - clean Japanese business design.
Version: 2.0
Author: Antigravity
Text Domain: ugc-template-hub
*/

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:       #1e3a5f;
  --navy-dark:  #142a47;
  --blue:       #2563a8;
  --blue-light: #e8f0fa;
  --accent:     #c8102e;
  --gray-50:    #f8f9fb;
  --gray-100:   #f0f2f5;
  --gray-200:   #e4e7ec;
  --gray-400:   #9ca3af;
  --gray-600:   #6b7280;
  --gray-800:   #1f2937;
  --white:      #ffffff;
  --text:       #1f2937;
  --text-sub:   #6b7280;
  --border:     #e4e7ec;
  --radius:     6px;
  --radius-sm:  4px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow:     0 2px 8px rgba(0,0,0,0.10);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --transition: all 0.18s ease;
  --copy-size: 1.08rem;
  --copy-size-compact: 1rem;
  --copy-line-height: 1.9;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic Pro', 'メイリオ', sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
}

a { color: var(--blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--navy); text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 2px solid var(--navy);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.header-inner {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-logo a:hover { text-decoration: none; color: var(--navy-dark); }

.site-logo-img {
  width: 190px;
  height: auto;
  display: block;
}

.custom-logo {
  max-height: 32px;
  width: auto;
  display: block;
}
.logo-mark {
  background: var(--navy);
  color: #fff;
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

#site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

#site-nav a {
  color: var(--gray-600);
  font-size: 0.88rem;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
}

#site-nav a:hover {
  color: var(--navy);
  background: var(--gray-100);
  text-decoration: none;
}

.mobile-menu-toggle {
  display: none;
  width: 64px;
  height: 54px;
  margin-right: -10px;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  line-height: 1;
}

.mobile-menu-toggle:hover {
  background: var(--gray-50);
}

.mobile-menu-icon,
.mobile-menu-icon::before,
.mobile-menu-icon::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-menu-icon {
  position: relative;
  flex: 0 0 auto;
}

.mobile-menu-icon::before,
.mobile-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.mobile-menu-icon::before { top: -7px; }
.mobile-menu-icon::after { top: 7px; }

.mobile-menu-label {
  color: var(--text);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  display: block;
  white-space: nowrap;
  transform: translateY(2px);
}

.mobile-menu-toggle.is-open .mobile-menu-icon {
  background: transparent;
}

.mobile-menu-toggle.is-open .mobile-menu-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.mobile-menu-toggle.is-open .mobile-menu-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.mobile-menu {
  display: none;
}

.btn-nav-login {
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

.btn-nav-primary {
  background: var(--navy) !important;
  color: var(--white) !important;
  font-weight: 600 !important;
}

.btn-nav-primary:hover {
  background: var(--navy-dark) !important;
  color: var(--white) !important;
}

/* ===== LAYOUT ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 24px; }
.section-sm { padding: 40px 24px; }

/* ===== SECTION HEADER ===== */
.section-header { margin-bottom: 36px; }
.section-header.center { text-align: center; }

.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  border-left: 3px solid var(--navy);
  padding-left: 8px;
  margin-bottom: 8px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-sub);
  font-size: 0.92rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--navy-dark);
  color: var(--white);
}

.btn-outline {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--navy);
}

.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
}

.btn-ghost {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--gray-200);
  color: var(--text);
}

.btn-copy {
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid #b8d0f0;
  font-size: 0.82rem;
  padding: 5px 12px;
}

.btn-copy:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.btn-edit-card {
  font-size: 0.82rem;
  padding: 6px 16px;
  background: var(--accent);
  color: var(--white);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  position: relative;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(200, 16, 46, 0.3);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
}

.btn-edit-card:hover {
  background: #a80d25;
  color: var(--white);
  border-color: #a80d25;
  box-shadow: 0 6px 16px rgba(200, 16, 46, 0.45);
  transform: translateY(-3px) scale(1.05);
  text-decoration: none;
}

/* Uniform card action button heights */
.card-action-btn {
  font-size: 0.75rem !important;
  padding: 0 12px !important;
  height: 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  border-width: 1px !important;
  white-space: nowrap;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

/* ===== HERO ===== */
#hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(125deg, rgba(200,16,46,0.22) 0%, transparent 28%),
    linear-gradient(145deg, #173150 0%, #1e3a5f 54%, #123f49 100%);
  color: var(--white);
  padding: 72px 24px 60px;
  border-bottom: 4px solid var(--accent);
}

#hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.065) 1px, transparent 1px),
    linear-gradient(135deg, transparent 47%, rgba(255,255,255,0.12) 47.2%, transparent 47.6%);
  background-size: 68px 68px, 68px 68px, 360px 360px;
  opacity: 0.62;
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(112deg, transparent 0 58%, rgba(255,255,255,0.10) 58% 66%, transparent 66% 100%),
    linear-gradient(112deg, transparent 0 72%, rgba(200,16,46,0.34) 72% 82%, transparent 82% 100%),
    linear-gradient(0deg, rgba(0,0,0,0.08), transparent 42%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.hero-eyecatch {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 4px 14px;
  border-radius: 2px;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.2);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 800;
  line-height: 1.28;
  margin-bottom: 16px;
  color: var(--white);
}

.hero-nowrap {
  white-space: nowrap;
}

.hero-mobile-break {
  display: none;
}

.hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.9;
  margin-bottom: 32px;
}

/* ===== HERO SEARCH ===== */
.hero-search {
  display: flex;
  max-width: 560px;
  margin: 0 auto 40px;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(0,0,0,0.24);
}

.hero-search input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 20px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  min-width: 0;
}

.hero-search input[type="text"]::placeholder {
  color: var(--gray-400);
  font-size: 0.92rem;
}

.hero-search button {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.hero-search button:hover {
  background: #a80d25;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-actions .btn-primary {
  background: var(--white);
  color: var(--navy);
}

.hero-actions .btn-primary:hover {
  background: var(--gray-100);
  color: var(--navy);
}

.hero-actions .btn-outline {
  border-color: rgba(255,255,255,0.5);
  color: var(--white);
  background: transparent;
}

.hero-actions .btn-outline:hover {
  background: rgba(255,255,255,0.1);
  color: var(--white);
}

.hero-stats {
  display: flex;
  gap: 0;
  justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 32px;
}

.hero-stat {
  flex: 1;
  max-width: 160px;
  border-right: 1px solid rgba(255,255,255,0.15);
  padding: 0 24px;
}

.hero-stat:last-child { border-right: none; }

.hero-stat .num {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
  margin-bottom: 4px;
}

.hero-stat .label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
}

/* ===== FEATURES ===== */
#features { background: var(--gray-50); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.feature-item {
  background: var(--white);
  padding: 28px 24px;
}

.feature-icon-wrap {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.feature-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.feature-desc {
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 1.7;
}

/* ===== CATEGORY SECTION ===== */
#categories { background: var(--white); }

.cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.88rem;
  padding: 7px 16px;
  border-radius: 2px;
  text-decoration: none;
  transition: var(--transition);
}

.cat-tag:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  text-decoration: none;
}

.cat-tag .count {
  font-size: 0.75rem;
  color: var(--text-sub);
  background: var(--gray-200);
  padding: 1px 6px;
  border-radius: 10px;
}

.cat-tag:hover .count {
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
}

/* ===== TEMPLATE CARDS ===== */
#latest-templates { background: var(--gray-50); border-top: 1px solid var(--border); }

.templates-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.template-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: var(--transition);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: stretch;
  overflow: visible;
}

.stretched-link::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
}

.template-card-main-link {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: block;
  border-radius: 8px 0 0 8px;
}

.template-card-main-link:focus-visible {
  outline: 3px solid rgba(37,99,168,0.45);
  outline-offset: -5px;
}

.template-card:hover {
  border-color: var(--navy);
  box-shadow: 0 10px 28px rgba(30,58,95,0.10);
  z-index: 20;
}

.template-card-top {
  padding: 18px 20px;
  flex: 1;
  border-right: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 0;
  position: relative;
  min-width: 0;
  cursor: pointer;
  isolation: isolate;
}

.template-card-top > :not(.template-card-hover-text):not(.template-card-main-link) {
  position: relative;
  z-index: 2;
}

.template-cat-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--blue);
  background: var(--blue-light);
  padding: 2px 8px;
  border-radius: 2px;
  margin-bottom: 10px;
}

.template-card h3 {
  font-size: 1.03rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.5;
}

.template-card h3 a { color: var(--text); text-decoration: none; }
.template-card h3 a:hover { color: var(--navy); text-decoration: underline; }

.template-preview {
  font-size: 0.83rem;
  color: var(--text-sub);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.template-card-hover-text {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 4;
  max-height: min(300px, calc(100vh - 140px));
  overflow: hidden;
  padding: 16px 18px;
  border: 1px solid #b8d0f0;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.98);
  color: var(--text);
  box-shadow: 0 16px 34px rgba(30,58,95,0.18);
  display: block;
  font-size: 0.92rem;
  line-height: 1.85;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  white-space: pre-wrap;
}

.template-card-top:hover .template-card-hover-text,
.template-card-top:focus-within .template-card-hover-text {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.template-card-bottom {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  background: #fbfcfe;
  position: relative;
  z-index: 10;
  border-radius: 0;
}

@keyframes toastFadeUp {
  0% { opacity: 0; transform: translate(-50%, -30%); }
  15% { opacity: 1; transform: translate(-50%, -50%); }
  85% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -70%); }
}

.copy-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(30,58,95,0.97);
  color: #fff;
  padding: 18px 34px;
  border-radius: 999px;
  font-weight: bold;
  font-size: 1.16rem;
  z-index: 99999;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  white-space: nowrap;
  animation: toastFadeUp 1.8s ease forwards;
}

.copy-toast::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #28a745;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.28);
}

.template-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-sub);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.template-author span:not(.author-avatar) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-card-meta-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.prompt-copy-count {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: max-content;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--text-sub);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.popular-rank-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.popular-rank-badge ~ .template-card-top h3 {
  padding-right: 48px;
}

.template-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.author-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== HOW IT WORKS ===== */
#how-it-works { background: var(--white); }

.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  counter-reset: step-counter;
}

.step-item {
  counter-increment: step-counter;
  position: relative;
  padding-left: 0;
  text-align: center;
}

.step-num {
  width: 44px; height: 44px;
  background: var(--navy);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 auto 14px;
}

.step-item h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.step-item p {
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 1.7;
}

/* ===== CTA ===== */
#cta-section {
  background: var(--navy);
  padding: 56px 24px;
}

.cta-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.cta-inner h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
  line-height: 1.5;
}

.cta-inner p {
  color: rgba(255,255,255,0.75);
  font-size: 0.92rem;
  margin-bottom: 28px;
}

.cta-inner .btn-primary {
  background: var(--white);
  color: var(--navy);
}

.cta-inner .btn-primary:hover {
  background: var(--gray-100);
}

/* ===== FOOTER ===== */
#site-footer {
  background: var(--gray-800);
  color: rgba(255,255,255,0.7);
  padding: 48px 24px 28px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 24px;
}

.footer-logo-img {
  width: 190px;
  height: auto;
  display: block;
  margin-bottom: 14px;
}

.footer-brand .logo-text { color: var(--white); font-size: 1rem; font-weight: 700; display: block; margin-bottom: 10px; }
.footer-brand p { font-size: 0.85rem; line-height: 1.8; color: rgba(255,255,255,0.55); }

.footer-col h5 {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 0.88rem; color: rgba(255,255,255,0.65); text-decoration: none; transition: var(--transition); }
.footer-col ul li a:hover { color: var(--white); }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

.footer-bottom a {
  color: rgba(255,255,255,0.62);
  text-decoration: none;
}

.footer-bottom a:hover {
  color: var(--white);
  text-decoration: underline;
}

/* ===== FORMS ===== */
.page-form-wrap {
  padding: 60px 24px;
  min-height: 80vh;
  background: var(--gray-50);
}

.form-box {
  max-width: 680px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-group label .req {
  color: var(--accent);
  margin-left: 3px;
  font-size: 0.78rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 13px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--white);
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30,58,95,0.08);
}

.form-group textarea { resize: vertical; min-height: 200px; line-height: 1.8; }

.field-rule-note {
  color: var(--text-sub);
  font-size: 0.78rem;
  line-height: 1.6;
  margin: -2px 0 6px;
}

.field-error {
  display: none;
  color: var(--accent);
  background: #fef2f2;
  border-left: 3px solid var(--accent);
  padding: 7px 10px;
  margin: 0 0 8px;
  font-size: 0.82rem;
  line-height: 1.6;
}

.field-error.is-visible {
  display: block;
}

.form-group textarea.field-invalid {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.10);
}

.btn.is-disabled,
button.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== NOTICES ===== */
.notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 20px;
  border-left: 4px solid;
}

.notice-success { background: #f0faf4; border-color: #28a745; color: #1d6b31; }
.notice-error   { background: #fef2f2; border-color: var(--accent); color: #9b1c1c; }
.notice-info    { background: var(--blue-light); border-color: var(--blue); color: var(--navy); }

/* ===== SINGLE TEMPLATE ===== */
.single-template-wrap {
  padding: 40px 24px 64px;
  min-height: 80vh;
  background: var(--gray-50);
}

.single-col { max-width: 820px; margin: 0 auto; }

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-sub); text-decoration: none; }
.breadcrumb a:hover { color: var(--navy); text-decoration: underline; }

.template-meta-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 16px;
}

.template-meta-bar h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  line-height: 1.4;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.83rem;
  color: var(--text-sub);
}

.meta-row .author-link { color: var(--blue); text-decoration: none; }
.meta-row .author-link:hover { text-decoration: underline; }

.template-desc-box {
  background: var(--blue-light);
  border: 1px solid #b8d0f0;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--navy);
  line-height: 1.8;
}

.template-body-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.template-body-header {
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.template-body-header span {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
}

.copy-main-btn {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: var(--transition);
}

.copy-main-btn:hover { background: var(--navy-dark); }

.template-text-content {
  padding: 28px 28px;
  white-space: pre-wrap;
  font-size: 0.93rem;
  line-height: 2;
  color: var(--text);
}

/* ===== PAGE ===== */
.page-wrap {
  min-height: 80vh;
  background: var(--gray-50);
  padding: 40px 24px 64px;
}

.page-col {
  max-width: 820px;
  margin: 0 auto;
}

.page-content-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.page-header {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  color: var(--navy);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
}

.page-body {
  font-size: 0.94rem;
  line-height: 2;
}

.page-body > * + * {
  margin-top: 1em;
}

.page-body ul,
.page-body ol {
  padding-left: 1.5em;
}

.page-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== ARTICLES ===== */
.article-index-wrap,
.article-single-wrap {
  min-height: 80vh;
  background: var(--gray-50);
  padding: 40px 24px 64px;
}

.article-col {
  max-width: 880px;
  margin: 0 auto;
}

.article-list {
  display: grid;
  gap: 16px;
}

.article-list-item,
.article-content-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.article-list-item {
  position: relative;
  padding: 24px 28px;
  transition: var(--transition);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.article-list-item:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow);
}

.article-list-meta {
  color: var(--text-sub);
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.article-card-link {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: var(--radius);
}

.article-thumb {
  position: relative;
  z-index: 2;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-list-body {
  min-width: 0;
}

.article-list-item h2,
.article-list-item p,
.article-list-meta,
.article-read-more,
.article-list-body {
  position: relative;
  z-index: 2;
}

.article-list-item h2 {
  color: var(--navy);
  font-size: 1.16rem;
  line-height: 1.5;
  margin-bottom: 8px;
}

.article-list-item h2 a {
  color: var(--navy);
  text-decoration: none;
}

.article-list-item h2 a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.article-list-item p {
  color: var(--text-sub);
  font-size: 0.9rem;
  line-height: 1.8;
}

.article-read-more {
  display: inline-flex;
  margin-top: 14px;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.article-read-more:hover {
  color: var(--navy);
  text-decoration: underline;
}

.article-content-box {
  padding: 32px;
}

.article-header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  padding-bottom: 18px;
}

.article-header h1 {
  color: var(--navy);
  font-size: 1.72rem;
  line-height: 1.45;
}

.article-hero-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 28px;
  background: var(--gray-100);
}

.article-hero-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-body {
  font-size: 0.95rem;
  line-height: 2;
}

.article-body > * + * {
  margin-top: 1em;
}

.article-body h2 {
  color: var(--navy);
  font-size: 1.22rem;
  line-height: 1.5;
  margin-top: 2em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article-body h3 {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-top: 1.6em;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5em;
}

.article-body strong {
  color: var(--navy);
}

.article-empty {
  color: var(--text-sub);
  text-align: center;
}

/* ===== ARCHIVE / LIST ===== */
.archive-wrap {
  min-height: 80vh;
  background: var(--gray-50);
  padding: 40px 24px 64px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.filter-tag {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.83rem;
  color: var(--text-sub);
  background: var(--white);
  text-decoration: none;
  transition: var(--transition);
}

.filter-tag:hover, .filter-tag.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  text-decoration: none;
}

/* ===== MY PAGE ===== */
.mypage-header {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}

.mypage-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
}

.mypage-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mypage-header-actions .btn {
  min-height: 46px;
  white-space: nowrap;
}

.mypage-display-name-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.mypage-display-name-text[hidden],
.mypage-display-name-edit[hidden],
.mypage-header-actions [hidden] {
  display: none !important;
}

.mypage-display-name-edit {
  margin-bottom: 6px;
}

.mypage-display-name-edit input[type="text"] {
  width: min(360px, 100%);
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--white);
  padding: 9px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.mypage-display-name-edit input[type="text"]:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30,58,95,0.08);
}

.mypage-filter {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  grid-template-columns: 220px minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.mypage-filter-field label {
  display: block;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.mypage-filter-field select,
.mypage-filter-field input[type="search"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--white);
  padding: 9px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.mypage-filter-field select:focus,
.mypage-filter-field input[type="search"]:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(30,58,95,0.08);
}

.mypage-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mypage-filter-actions .btn {
  min-height: 42px;
  padding: 0 18px;
  white-space: nowrap;
}

.mypage-filter-result {
  color: var(--text-sub);
  font-size: 0.86rem;
  margin: 0 0 18px;
}

/* ===== READABILITY TEXT SCALE ===== */
p,
.hero-sub,
.section-desc,
.page-body,
.page-body p,
.page-body li,
.page-content-box p,
.article-body,
.article-body p,
.article-body li,
.article-list-item p,
.template-desc-box,
.template-text-content,
.cta-inner p {
  font-size: var(--copy-size);
  line-height: var(--copy-line-height);
}

.feature-desc,
.template-preview,
.step-item p,
.footer-brand p {
  font-size: var(--copy-size-compact);
  line-height: 1.85;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #site-header {
    padding: 0 16px;
    height: 58px;
  }
  .header-inner {
    gap: 10px;
  }
  #site-nav {
    display: none;
  }
  .site-logo-img {
    width: 164px;
  }
  .mobile-menu-toggle {
    display: inline-flex;
  }
  .mobile-menu {
    display: none;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 2px solid var(--navy);
    box-shadow: 0 12px 28px rgba(30,58,95,0.15);
    padding: 8px 16px 14px;
    z-index: 99;
  }
  .mobile-menu.is-open {
    display: grid;
  }
  .mobile-menu a {
    color: var(--text);
    display: flex;
    align-items: center;
    min-height: 44px;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
  }
  .mobile-menu a:last-child {
    border-bottom: 0;
  }
  .mobile-menu a:hover {
    color: var(--navy);
    text-decoration: none;
  }
  .section { padding: 48px 16px; }
  .hero-title {
    font-size: clamp(1.8rem, 8.4vw, 2.35rem);
    line-height: 1.34;
  }
  .hero-mobile-break {
    display: inline;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 4px; }
  .mypage-header {
    align-items: flex-start;
  }
  .mypage-header-actions {
    width: 100%;
    margin-left: 84px;
    justify-content: flex-start;
  }
  .hero-stats { gap: 0; flex-wrap: nowrap; }
  .hero-stat { padding: 0 16px; }
  .hero-stat .num { font-size: 1.4rem; }
  .form-box { padding: 24px 20px; }
  .template-text-content { padding: 20px; }
  .template-card {
    grid-template-columns: 1fr;
  }
  .template-card-top {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .template-card-main-link {
    border-radius: 8px 8px 0 0;
  }
  .template-card-bottom {
    background: var(--gray-50);
  }
  .template-card-meta-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .mypage-filter {
    grid-template-columns: 1fr;
  }
  .mypage-filter-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .hero-stat:nth-child(3) { display: none; }
  .page-content-box { padding: 22px 18px; }
  .article-list-item,
  .article-content-box { padding: 22px 18px; }
  .article-list-item {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .article-header h1 { font-size: 1.35rem; }
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-40 { margin-top: 40px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* Pagination */
.page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 32px;
}

.page-numbers a, .page-numbers span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-sub);
  background: var(--white);
  text-decoration: none;
  transition: var(--transition);
}

.page-numbers a:hover { border-color: var(--navy); color: var(--navy); }
.page-numbers .current { background: var(--navy); color: var(--white); border-color: var(--navy); }
