/**
 * Modern CSS Reset
 * モダンなCSSリセット - ブラウザのデフォルトスタイルを標準化
 */

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

/* Remove default margin and padding */
* {
  margin: 0;
  padding: 0;
}

/* HTML & Body */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-body);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
}

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--spacing-6);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--spacing-5);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-4);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--spacing-3);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-3);
}

h6 {
  font-size: var(--font-size-base);
  margin-bottom: var(--spacing-2);
}

p {
  margin-bottom: var(--spacing-4);
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Lists */
ul, ol {
  list-style: none;
}

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

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
}

/* Remove default button styles */
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Prevent text overflow */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Selection */
::selection {
  background-color: var(--color-primary-100);
  color: var(--text-primary);
}

/* Scrollbar styling (WebKit) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: var(--radius-base);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* Print styles */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}
