/* Coffee Card - Branding & Styles */

:root {
  --bg-light: #f8f6f4;
  --text-dark: #2b211c;
  --accent-red: #c0392b;
  --accent-red-dark: #a93226;
  --border-gray: #e8e6e4;
  --footer-dark: #4a4340;
  --success-green: #27ae60;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  /* Increased line-height from 1.6 to 1.75 for better readability and breathing room */
  line-height: 1.75;
  /* Increase base font size from 1rem to 1.0625rem (17px) for improved legibility */
  font-size: 1.0625rem;
}

/* Typography
 * Scale uses a 1.5 ratio between most sizes for visual hierarchy
 * Line-height decreases with heading size for balanced proportions
 * Margins create consistent vertical rhythm throughout the page
 */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: var(--text-dark);
  /* Consistent heading margins create predictable spacing: 1.75rem top, 0.75rem bottom */
  margin: 1.75rem 0 0.75rem 0;
}

/* Hero h1: Page headline, largest scale, tighter line-height for control */
h1 {
  font-size: 2.75rem;
  line-height: 1.2;
  margin-top: 0;
}

/* Section h2: Primary section headings, prominent but proportional to body text */
h2 {
  font-size: 1.875rem;
  line-height: 1.25;
}

/* Subsection h3: Feature titles and secondary headings, clear visual separation */
h3 {
  font-size: 1.25rem;
  line-height: 1.35;
}

/* h4: Minor headings, close to body size but with emphasis */
h4 {
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 600;
}

/* h5 & h6: Small headings, maintain readability at smaller scale */
h5 {
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 600;
}

h6 {
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 600;
}

p {
  /* Increased paragraph spacing from 1rem to 1.25rem for better visual separation */
  margin-bottom: 1.25rem;
  /* Font size inherited from body (1.0625rem) for consistency */
}

a {
  color: var(--accent-red);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
header {
  background-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
}

.logo {
  display: inline-block;
  text-decoration: none;
}

.site-title {
  font-family: 'Arvo', serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #2C2C2C;
  text-decoration: none;
}

.logo img {
  height: 40px;
  width: auto;
}

nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav a {
  color: var(--text-dark);
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--accent-red);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--bg-light) 0%, #f0ebe7 100%);
  padding: 4rem 2rem;
  border-bottom: 2px solid var(--accent-red);
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  max-width: 1200px;
}

.hero-content {
  text-align: left;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-card {
  max-width: 420px;
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 16px;
  background: transparent;
  transition: all 0.3s ease;
}


.hero h1 {
  color: var(--text-dark);
  /* Scale proportionally to new base size: 1.8rem / 1rem * 1.0625rem = ~1.9125rem */
  font-size: 1.9rem;
  margin-bottom: 1.5rem;
  text-align: left;
  font-weight: 700;
  /* Tighten line-height slightly for hero headline prominence */
  line-height: 1.25;
}

.hero .subhead {
  /* Scale proportionally: 1.1rem / 1rem * 1.0625rem = ~1.169rem */
  font-size: 1.125rem;
  color: #555;
  margin-bottom: 2rem;
  text-align: left;
  /* Match base body line-height for consistency */
  line-height: 1.5;
}

/* Buttons */
button, .btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  margin: 0.5rem;
  background-color: var(--accent-red);
  color: white;
  border: none;
  border-radius: 0.5rem;
  /* Updated to match new body font size for readability and consistency */
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
}

button:hover, .btn:hover {
  background-color: var(--accent-red-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
}

button:active, .btn:active {
  transform: translateY(0);
}

/* Cards */
.card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--accent-red);
}

.cafe-card h3 {
  padding-right: 5rem;
}

.card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

/* Clickable café cards */
.cafe-card {
  cursor: pointer;
  position: relative;
}

.cafe-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
}

/* Local Impact Badge */
.local-impact-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-block;
  padding: 0.375rem 0.625rem;
  background-color: #efefef;
  border-radius: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

/* Feature grid (What is Coffee Card section) */
.feature-grid {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

/* Forms */
form {
  background: white;
  padding: 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  max-width: 600px;
  margin: 2rem auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-gray);
  border-radius: 0.5rem;
  font-family: inherit;
  /* Updated to match new body font size for consistency */
  font-size: 1.0625rem;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Footer */
footer {
  background-color: var(--footer-dark);
  color: white;
  padding: 3rem 2rem;
  margin-top: 2.5rem;
}

footer .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

footer h4 {
  color: white;
  margin-top: 0;
}

footer a {
  color: #ddd;
}

footer a:hover {
  color: var(--accent-red);
}

footer ul {
  list-style: none;
}

footer ul li {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  color: #aaa;
}

/* Thanks Page */
.thanks-message {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.thanks-message .icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.thanks-message h2 {
  color: var(--accent-red);
}

/* Admin Styles */
.admin-header {
  background-color: #f0f0f0;
  padding: 2rem;
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h2 {
  margin: 0;
}

.admin-actions {
  display: flex;
  gap: 1rem;
}

.suggestions-list {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.suggestion-item {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-gray);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-details {
  display: grid;
  gap: 0.5rem;
}

.suggestion-detail-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
  font-size: 0.95rem;
}

.suggestion-detail-row strong {
  color: var(--text-dark);
}

.suggestion-meta {
  text-align: right;
  color: #999;
  font-size: 0.9rem;
}

/* Café Overlay */
.cafe-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.cafe-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cafe-modal {
  background: white;
  border-radius: 1rem;
  padding: 2.5rem;
  max-width: 500px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cafe-modal h2 {
  margin-top: 0;
  color: var(--accent-red);
  padding-right: 2rem;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-dark);
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
  margin: 0;
}

.close-btn:hover {
  color: var(--accent-red);
  transform: none;
  box-shadow: none;
}

/* Modal Navigation Controls */
.modal-nav-controls {
  display: none;
}

.modal-nav-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-gray);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  color: var(--text-dark);
  font-size: 1.25rem;
  font-weight: 600;
  pointer-events: all;
  transition: all 0.2s ease;
  margin: 0 1rem;
}

.modal-nav-btn:hover {
  background: white;
  border-color: var(--accent-red);
  color: var(--accent-red);
  transform: scale(1.1);
}

.modal-nav-btn:active {
  transform: scale(0.95);
}

.modal-content {
  margin-top: 1.5rem;
}

.modal-section {
  margin-bottom: 1.5rem;
}

.modal-section h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--accent-red);
  font-size: 1.1rem;
}

.modal-section p {
  margin: 0;
  /* Update line-height to match improved body typography */
  line-height: 1.75;
}

.modal-section .btn {
  display: inline-block;
  margin-top: 0.5rem;
}

/* Discount Box */
.discount-box {
  background-color: rgba(192, 57, 43, 0.08);
  border: 2px solid var(--accent-red);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

/* Local Impact Callout in Modal */
.modal-local-impact-callout {
  background-color: #fff5f5;
  border-left: 4px solid var(--accent-red);
  border-radius: 0.4rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.modal-local-impact-callout p {
  margin: 0;
  color: var(--accent-red);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Mailchimp Toast Popup */
.mailchimp-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--bg-light);
  border: 1px solid var(--border-gray);
  border-left: 3px solid #8b1f19;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  border-radius: 0.75rem;
  padding: 1.5rem;
  max-width: 360px;
  width: 320px;
  z-index: 800;
  animation: slideUpToast 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: none;
}

.mailchimp-toast.show {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mailchimp-toast.hidden {
  display: none;
}

@keyframes slideUpToast {
  from {
    transform: translateY(24px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.mailchimp-toast-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark);
  padding: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  margin: 0;
}

.mailchimp-toast-close:hover {
  color: var(--accent-red);
}

.mailchimp-toast-content {
  padding-right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mailchimp-toast-headline {
  margin: 0 0 0.5rem 0;
  font-size: 1.0625rem;
  line-height: 1.3;
  color: var(--text-dark);
  font-weight: 650;
}

.mailchimp-toast-subtext {
  margin: 0 0 0.5rem 0;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.4;
}

.mailchimp-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
  align-items: stretch;
  background: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  max-width: none;
  margin: 0;
}

.mailchimp-input {
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border-gray);
  border-radius: 0.4rem;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  margin: 0;
}

.mailchimp-input:focus {
  outline: none;
  border-color: #8b1f19;
  box-shadow: 0 0 0 3px rgba(139, 31, 25, 0.1);
}

.mailchimp-button {
  padding: 1rem 1.25rem;
  background-color: #8b1f19;
  color: white;
  border: none;
  border-radius: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
  white-space: nowrap;
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mailchimp-button:hover {
  background-color: #6b1812;
  box-shadow: 0 2px 8px rgba(139, 31, 25, 0.3);
  transform: translateY(-1px);
}

.mailchimp-button:active {
  transform: translateY(0) scale(0.98);
}

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.8rem; }

  header .container {
    flex-direction: column;
    gap: 1rem;
  }

  nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .hero {
    padding: 2.5rem 1.5rem;
  }

  .hero-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-content {
    text-align: center;
  }

  .hero h1 {
    font-size: 2rem;
    text-align: center;
  }

  .hero .subhead {
    text-align: center;
  }

  .hero-image {
    margin-top: 1rem;
  }

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

  form {
    margin: 1.5rem 0;
    padding: 1.5rem;
  }

  .suggestion-item {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .suggestion-detail-row {
    grid-template-columns: 100px 1fr;
  }

  .suggestion-meta {
    text-align: left;
  }

  .admin-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .admin-header h2 {
    width: 100%;
  }

  .admin-actions {
    width: 100%;
    justify-content: center;
  }

  /* Modal responsive */
  .cafe-modal {
    padding: 1.5rem;
    max-width: 95vw;
    max-height: 90vh;
  }

  .cafe-modal h2 {
    padding-right: 1.5rem;
  }

  .close-btn {
    top: 0.75rem;
    right: 0.75rem;
  }

  /* Mailchimp Toast - Full width on mobile */
  .mailchimp-toast {
    bottom: 0;
    right: 0;
    left: 0;
    max-width: none;
    width: 100%;
    margin: 0;
    border-radius: 0.75rem 0.75rem 0 0;
    border-bottom: none;
    border-left: 3px solid #8b1f19;
    padding: 1.25rem;
  }

  .mailchimp-button {
    padding: 1rem 1rem;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none; }
