/* ===================================
   Three Shapes Aikido - Stylesheet
   =================================== */

/* CSS Variables */
:root {
  --bg: rgb(255, 255, 255);
  --ink: #111;
  --muted: #666;
  --line: #e5e5e5;
  --card: #ffffffcc;
  --card2: #ffffffb3;
  --brand: #111;

  /* Extended color system */
  --white: #fff;
  --text-dark: #222;
  --text-light: #444;
  --border: #d0d0d0;
  --hover-bg: #f2f2f2;
  --pill-bg: #f3f3f3;
  --input-bg: #fff;

  /* Spacing scale */
  --space-xs: 0.2rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.25rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
}

/* ===================================
   Reset & Base Styles
   =================================== */

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Libre Franklin', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===================================
   Layout Components
   =================================== */

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--brand);
  color: var(--white);
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}

.spacer {
  flex: 1;
}

/* Logo */
.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-shapes-image {
  height: 80px;
  width: auto;
  display: block;
}

.logo-aikido-image {
  height: 80px;
  width: auto;
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.logo-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  font-style: italic;
  line-height: 1.2;
  text-align: center;
}

.kanji-vertical {
  writing-mode: vertical-rl;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-light);
  height: 80px;
  display: flex;
  align-items: center;
}

@media (max-width: 640px) {
  .logo-shapes-image {
    height: 60px;
  }

  .logo-aikido-image {
    height: 60px;
  }

  .logo-title {
    font-size: 1.1rem;
  }

  .logo-subtitle {
    font-size: 0.7rem;
  }

  .kanji-vertical {
    font-size: 1.4rem;
    height: 60px;
  }
}

/* Navigation */
nav a {
  display: inline-block;
  padding: var(--space-sm) 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

nav a.active,
nav a:hover {
  background: var(--brand);
  color: var(--white);
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Mobile Navigation */
.mobile-toggle {
  display: none;
}

.mobile-menu {
  display: none;
}

@media (max-width: 860px) {
  .primary-nav {
    display: none;
  }

  .mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: var(--space-sm) 0.75rem;
    background: var(--white);
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
  }

  .mobile-menu {
    position: absolute;
    right: var(--space-lg);
    top: 4.25rem;
    width: 11rem;
    border: 1px solid var(--line);
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    display: none;
  }

  .mobile-menu.open {
    display: block;
  }

  .mobile-menu a {
    display: block;
    padding: 0.6rem 0.8rem;
    text-decoration: none;
    color: var(--text-dark);
    border-radius: 10px;
    margin: 0.2rem;
  }

  .mobile-menu a:hover {
    background: var(--hover-bg);
  }
}

/* Main Content */
main {
  position: relative;
  z-index: 10;
  flex: 1 0 auto;
}

section {
  scroll-margin-top: 80px;
}

/* ===================================
   Card & Panel Components
   =================================== */

.hero,
.card,
.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.hero {
  padding: var(--space-xl);
}

.card {
  padding: var(--space-md);
}

.panel {
  padding: var(--space-lg);
  background: var(--card2);
}

/* ===================================
   Grid Layouts
   =================================== */

.grid {
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 860px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 639px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ===================================
   Typography
   =================================== */

.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.muted a {
  color: var(--brand);
  text-decoration: underline;
}

.muted a:hover {
  color: var(--ink);
}

.panel .muted a {
  font-weight: 600;
}

.heading-xl {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0;
}

.section-header {
  font-size: 1.8rem;
  margin: 0.2rem 0;
}

.subsection-header {
  font-size: 1.4rem;
  margin: 1.5rem 0 0.2rem;
}

.card-heading {
  margin: 0.6rem 0 0;
}

.panel-heading {
  margin: 0.2rem 0;
}

/* ===================================
   Buttons
   =================================== */

.btn {
  display: inline-block;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--white);
  text-decoration: none;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

.btn.alt {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--border);
}

.button-group {
  margin-top: var(--space-md);
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ===================================
   Utility Classes
   =================================== */

.pill {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.25rem var(--space-sm);
  border-radius: 999px;
  background: var(--pill-bg);
}

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

.section-spacing {
  margin-top: var(--space-xl);
}

.section-spacing-sm {
  margin-top: var(--space-md);
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-wrapper {
  height: 40px;
  width: 40px;
}

ul.clean {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ===================================
   Page-Specific Components
   =================================== */

/* Hero Section */
.hero-description {
  font-size: 1.1rem;
  max-width: 70ch;
  margin-top: 0.75rem;
}

.hero-description a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s;
}

.hero-description a:hover {
  border-bottom-color: var(--brand);
}

/* Values Cards */
.values-card-icon {
  height: 40px;
  width: 40px;
}

/* Schedule */
.schedule .day {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  padding: var(--space-md);
}

.schedule-item {
  display: flex;
  justify-content: space-between;
}

.schedule-note {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.event-date {
  background: var(--brand);
  color: var(--white);
  border-radius: 10px;
  padding: 0.35rem var(--space-sm);
  text-align: center;
  font-size: 0.75rem;
  min-width: 2.5rem;
}

/* Contact Section */
.contact-card-content {
  margin-top: 0.2rem;
}

/* Form */
.form-grid {
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  margin-top: 0.25rem;
}

.form-input:focus,
.form-textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.form-note {
  font-size: 0.85rem;
  margin-left: 0.4rem;
}

/* Teachers */
.teacher-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.teacher-avatar {
  height: 120px;
  width: 120px;
  border-radius: 14px;
  background: #f1f1f1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  margin-bottom: 1rem;
}

.teacher-photo {
  width: 100%;
  max-width: 250px;
  height: auto;
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
  margin-bottom: 1rem;
}

.teacher-name {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.teacher-title {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

/* Aikido Page */
.aikido-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
}

.aikido-photo {
  width: 50%;
  height: auto;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#aikido ul {
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}

#aikido ul li {
  margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
  .aikido-photos {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Affiliation */
.affiliation-image {
  width: 80%;
  height: auto;
  display: block;
  margin: 0 auto var(--space-md);
  padding: var(--space-xl);
  background: #676767;
  border-radius: 18px;
}

/* Events */
.events-list {
  margin-top: var(--space-md);
  display: grid;
  gap: var(--space-md);
}

.event-item {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.event-content {
  padding-top: 0.2rem;
}

.event-title {
  font-weight: 700;
}

.event-description {
  font-size: 0.95rem;
}

/* ===================================
   Footer
   =================================== */

footer {
  margin-top: var(--space-2xl);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.footer-inner {
  padding: var(--space-md) 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
}

/* ===================================
   Decorative Background
   =================================== */

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.22;
  pointer-events: none;
}

/* Background Image */
body::before {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  width: 43%;
  height: 100vh;
  background-image: url('images/dojo-background.jpg');
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
  z-index: 0;
  opacity: 0.85;
  pointer-events: none;
}

@media (max-width: 860px) {
  body::before {
    width: 100%;
    background-position: center center;
    opacity: 0.08;
  }
}
