/*
 * Minimal utility and typography styles for englishtospanish.org.
 * This stylesheet is deliberately lightweight to ensure fast page
 * loads and high scores on performance metrics.  We avoid large
 * frameworks and instead define only the classes we need.
 */

/* CSS variables for consistent theming */
:root {
  --primary: #0066cc;
  --primary-dark: #004999;
  --gray-light: #f9f9f9;
  --gray: #e5e5e5;
  --text-dark: #1a1a1a;
  --text-white: #ffffff;
}

/* Web Fonts with font-display: swap for better performance */
@font-face {
  font-family: 'System';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('System UI'), local('-apple-system'), local('BlinkMacSystemFont');
}

@font-face {
  font-family: 'System';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local('System UI'), local('-apple-system'), local('BlinkMacSystemFont');
}

/* Global reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  color: var(--text-dark);
  background-color: #ffffff;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
p {
  margin-bottom: 1rem;
}

/* Remove default list bullets globally. Navigation lists and other
 * interface lists rely on unstyled lists. For rich article content
 * lists, styles are reintroduced under the `.prose` namespace below. */
ul, ol {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Utility classes (inspired by Tailwind but greatly simplified) */
.container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

@media (min-width: 1280px) {
  .container {
    padding-left: 4rem;
    padding-right: 4rem;
  }
}
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-grow { flex-grow: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.min-h-screen { min-height: 100vh; }
.space-x-4 > :not(:last-child) {
  margin-right: 1rem;
}
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.text-center { text-align: center; }

.bg-primary { 
  background-color: var(--primary);
}

/* Fix for header text visibility */
header.bg-primary a,
header.bg-primary nav a {
  color: var(--text-white) !important;
}

header nav a:hover {
  color: var(--text-white) !important;
  opacity: 0.9;
}
.bg-gray-100 { background-color: var(--gray-light); }
.border-t { border-top: 1px solid var(--gray); }
.shadow {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.text-white { color: #ffffff; }
.text-gray-900 { color: #1f2937; }
.text-gray-500 { color: #6b7280; }
.font-sans { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-xl { font-size: 1.25rem; }
.text-lg { font-size: 1.125rem; }
.text-sm { font-size: 0.875rem; }
.text-2xl { font-size: 1.5rem; }

.hover\:underline:hover { text-decoration: underline; }

/* Responsive grid for cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.card {
  border: 1px solid var(--gray);
  border-radius: 8px;
  padding: 1rem;
  background-color: #fff;
  transition: box-shadow 0.2s ease;
}
.card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* Article/page content wrapper */
.content-wrapper {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 1.5rem;
}

@media (min-width: 640px) {
  .content-wrapper {
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  .content-wrapper {
    padding: 3rem;
  }
}

/* Prose styles for rich content */
.prose h1, .prose h2, .prose h3, .prose h4 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}
.prose p {
  margin-bottom: 1rem;
}
.prose ul, .prose ol {
  margin-bottom: 1rem;
  margin-left: 1.5rem;
}
.prose ul {
  list-style-type: disc;
}
.prose ol {
  list-style-type: decimal;
}
.prose img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
}
.prose blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 4px solid var(--primary);
  color: var(--primary-dark);
  font-style: italic;
}

/* Table styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
th, td {
  padding: 0.5rem;
  border: 1px solid var(--gray);
}
th {
  background-color: var(--gray-light);
  font-weight: bold;
}
/* Forms */
input[type="text"], textarea, select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--gray);
  border-radius: 4px;
  font-size: 1rem;
}
button {
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}
button:hover {
  background-color: var(--primary-dark);
}

/* Additional class-based button styling to allow semantic buttons with custom class */
.button {
  background-color: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}
.button:hover {
  background-color: var(--primary-dark);
}

/* Main content container */
#content {
  width: 100%;
  margin: 0 auto;
}

#content > :not(.container):not(section) {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (min-width: 640px) {
  #content > :not(.container):not(section) {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1024px) {
  #content > :not(.container):not(section) {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

@media (min-width: 1280px) {
  #content > :not(.container):not(section) {
    padding-left: 4rem;
    padding-right: 4rem;
  }
}

/* Responsive breakpoints */
@media (min-width: 768px) {
  .md\:text-3xl { font-size: 1.875rem; }
}

/* Footer styling */
body > p:last-child {
  background-color: var(--gray-light);
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  border-top: 1px solid var(--gray);
}