/* ============================================
   AGRR Design System - Reset & Base Styles
   Created: 2025-10-12
   Purpose: ブラウザデフォルトのリセットと基本スタイル
   ============================================ */

/* ============================================
   Modern CSS Reset
   Based on modern-normalize and custom additions
   ============================================ */

/* Box Sizing - すべての要素にborder-boxを適用 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* HTML & Body */
html {
  line-height: var(--line-height-normal);
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  /* overflow-x: hidden; を削除して2重スクロールを防止 */
}

body {
  margin: 0;
  padding: 0;
  padding-top: var(--navbar-height);
  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);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* overflow-x: hidden; を削除して2重スクロールを防止 */
}

/* ナビゲーションバーがないページ用 */
body.no-navbar {
  padding-top: 0;
}

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

h1 {
  font-size: var(--font-size-4xl);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

/* Paragraphs */
p {
  margin: 0 0 var(--space-4) 0;
}

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

a:hover {
  color: var(--color-info-dark);
}

/* Lists */
ul, ol {
  margin: 0;
  padding: 0;
}

li {
  margin: 0;
}

/* Remove list styles for navigation */
nav ul,
nav ol {
  list-style: none;
}

/* Images */
img,
svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Buttons */
button {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

button:focus {
  outline: none;
}

/* Forms */
input,
textarea,
select {
  font-family: inherit;
  font-size: 100%;
  line-height: inherit;
  margin: 0;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
}

/* Remove default appearance */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* HR */
hr {
  height: 0;
  color: inherit;
  border-top-width: var(--border-width-1);
}

/* Code */
code,
kbd,
samp,
pre {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-sm);
}

/* Small Text */
small {
  font-size: var(--font-size-sm);
}

/* Bold & Strong */
b,
strong {
  font-weight: var(--font-weight-bold);
}

/* ============================================
   Accessibility
   ============================================ */

/* Focus Visible Styles */
:focus-visible {
  outline: 2px solid var(--color-info);
  outline-offset: 2px;
}

/* Reduce Motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================
   Screen Reader Only (sr-only)
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   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;
  }

  img {
    page-break-inside: avoid;
  }

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

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

