/* Large Screens (≥1400px) *//* StoryScrib.ai Global Styles */

/* CSS Custom Properties (Variables) */
:root {
  --primary-dark: #1a1a1a;
  --accent: #d4a857;
  --bg-light: #fdfaf6;
  --bg-secondary: #f7f3ef;
  --font-primary: 'Inter', sans-serif;
  --font-heading: 'Playfair Display', serif;
  --text-color: #1a1a1a;
  --card-bg: white;
  --footer-bg: #fff;
  --cta-bg: #fff7e6;
  --button-bg: #1a1a1a;
  --button-text: white;
}

:root.dark-mode {
  --primary-dark: #fdfaf6;
  --accent: #d4a857;
  --bg-light: #1a1a1a;
  --bg-secondary: #222;
  --text-color: #fdfaf6;
  --card-bg: #2c2c2c;
  --footer-bg: #111;
  --cta-bg: #2c2c2c;
  --button-bg: #fdfaf6;
  --button-text: #1a1a1a;
}

/* Global Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-primary);
  background-color: var(--bg-light);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

/* Typography */
h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

h2 {
  font-family: var(--font-heading);
  color: var(--text-color);
}

p {
  line-height: 1.6;
  color: var(--text-color);
}

a {
  color: var(--text-color);
  transition: color 0.3s;
}

/* Header Styles */
header {
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Logo Styles */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.logo img {
  width: 60px;
  height: 60px;
}

.logo-title {
  font-size: 1.5rem;
  font-family: var(--font-heading);
  font-weight: 600;
}

/* Navigation Styles */
nav, .nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-links a {
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
  transition: opacity 0.3s;
}

.nav-links a:hover {
  opacity: 0.7;
}

/* Dark Mode Toggle Button */
.toggle-btn {
  cursor: pointer;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  transition: background 0.3s, transform 0.2s;
}

.toggle-btn:hover {
  transform: translateY(-1px);
}

/* Main Content Layout */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Content Wrapper for Full-Width Pages */
.content-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 3rem 0;
}

:root:not(.dark-mode) hr {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Footer Styles */
footer {
  text-align: center;
  padding: 1.5rem 2rem;
  font-size: 0.875rem;
  background: var(--footer-bg);
  color: #888;
}

/* Button Styles */
.button, 
button {
  background: var(--button-bg);
  color: var(--button-text);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.3s, transform 0.2s;
}

.button:hover, 
button:hover {
  transform: translateY(-2px);
}

/* Card Styles */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  padding: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Full-Width Section Utilities */
.full-width {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

/* Downloads Page Specific Styles */
.downloads-page body {
  overflow-x: hidden;
}

.downloads-page main {
  flex: 1;
  padding: 0;
  max-width: none;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.downloads-hero {
  padding: 2rem 2rem 1rem;
  text-align: center;
  background: var(--card-bg);
  width: 100%;
}

.downloads-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-color);
}

.downloads-content {
  flex: 1;
  padding: 2rem 2rem;
  background: var(--bg-secondary);
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.downloads {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  width: 100%;
  justify-content: center;
}

.downloads .card {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.downloads .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.downloads .card h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.downloads .card p {
  margin-bottom: 1.5rem;
  color: var(--text-color);
  flex-grow: 1;
  line-height: 1.6;
  font-size: 1rem;
}

.downloads .card a {
  display: inline-block;
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  padding: 0.875rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.2s ease;
  margin-top: auto;
  font-size: 1rem;
}

.downloads .card a:hover:not([style*="pointer-events: none"]) {
  background: #333;
  transform: translateY(-2px);
}

.downloads .card a[style*="pointer-events: none"] {
  background: #666;
  opacity: 0.6;
}

.cta-coffee {
  background: var(--cta-bg);
  padding: 1.5rem 2rem;
  text-align: center;
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cta-coffee p {
  font-size: 1rem;
  color: var(--text-color);
  margin-bottom: 1rem;
  max-width: 600px;
}

.cta-coffee a {
  display: inline-block;
  background: #FFDD00;
  color: #000;
  font-weight: 600;
  padding: 0.875rem 1.75rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.cta-coffee a:hover {
  transform: translateY(-2px);
}

.footer-coffee {
  display: none;
  background: #FFDD00;
  color: #000;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-top: 1rem;
}

/* Responsive Design */

/* Mobile Devices (≤600px) */
@media (max-width: 600px) {
  main {
    padding: 1rem;
  }
  
  header {
    padding: 1rem;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .toggle-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .content-wrapper {
    padding: 0 1rem;
  }

  /* Downloads Page Mobile */
  .downloads-hero {
    padding: 2rem 1rem;
  }

  .downloads-hero h1 {
    font-size: 2rem;
  }

  .downloads-content {
    padding: 2rem 1rem;
  }

  .downloads {
    max-width: 100%;
  }

  .downloads .card {
    padding: 1.5rem;
    min-height: 140px;
  }

  .downloads .card h2 {
    font-size: 1.2rem;
  }

  .cta-coffee {
    padding: 1.5rem;
  }

  .cta-coffee p {
    font-size: 1rem;
  }
}

/* Tablet Devices (601px - 900px) */
@media (min-width: 601px) and (max-width: 900px) {
  main {
    padding: 1.5rem;
  }

  .header-content {
    padding: 0 1rem;
  }

  .content-wrapper {
    padding: 0 1.5rem;
  }

  /* Downloads Page Tablet */
  .downloads-content {
    padding: 2.5rem 1.5rem;
  }

  .downloads {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    gap: 1.5rem;
  }

  .downloads .card:last-child {
    grid-column: 1 / -1;
    max-width: 400px;
    margin: 0 auto;
  }
}

/* Desktop/Laptop Max Height Constraint (≥901px) */
@media (min-width: 901px) {
  .downloads-page body {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  .downloads-page main {
    flex: 1;
    max-height: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
  
  .downloads-page footer {
    flex-shrink: 0;
    margin-top: auto;
  }
  
  .downloads-content {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
  }
  
  .cta-coffee {
    flex-shrink: 0;
    padding: 1rem 2rem;
  }
}
@media (min-width: 1400px) {
  main {
    padding: 3rem 2rem;
  }

  /* Downloads Page Large Screens */
  .downloads-hero {
    padding: 3rem 2rem 2rem;
  }

  .downloads-hero h1 {
    font-size: 2.8rem;
  }

  .downloads {
    gap: 2.5rem;
    max-width: 1400px;
  }

  .downloads .card {
    min-height: 220px;
  }
}

/* Short Viewport Adjustment */
@media (max-height: 800px) {
  .cta-coffee {
    display: none;
  }

  footer .footer-coffee {
    display: inline-block;
  }

  .downloads-hero {
    padding: 3rem 2rem 2rem;
  }

  .downloads-content {
    padding: 2rem;
  }
}

/* Focus Styles for Keyboard Navigation */
.toggle-btn:focus,
.nav-links a:focus,
.button:focus,
button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  header,
  footer,
  .toggle-btn {
    display: none;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}