/* Cinema Magog Editorial Stylesheet */

/* CSS Variables - Magog Marquee Editorial Palette */
:root {
  --cm-primary: #2A2D7C;
  --cm-secondary: #0F6B6E;
  --cm-accent: #E04B2B;
  --cm-bg: #FBF7F1;
  --cm-surface: #FFFFFF;
  --cm-text: #14151A;
  --cm-muted: #4B4F5C;
  --cm-border: #D7D0C6;
  --cm-radius: 14px;
  --cm-shadow: 0 10px 30px rgba(20, 21, 26, 0.10);
  --cm-max: 1120px;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.7;
  color: var(--cm-text);
  background-color: var(--cm-bg);
  overflow-x: hidden;
}

/* Typography System - System Serif for Headings, Sans for Body */
h1, h2, h3, h4, h5, h6 {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--cm-primary);
}

h1 {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.75rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--cm-secondary);
}

h3 {
  font-size: 1.375rem;
  margin-top: 1.5rem;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--cm-secondary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  a {
    transition: none;
  }
}

a:hover {
  color: var(--cm-accent);
  text-decoration-color: var(--cm-accent);
}

a:focus-visible {
  outline: 3px solid var(--cm-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

a[rel*="external"]::after {
  content: " ↗";
  font-size: 0.85em;
  opacity: 0.7;
}

strong {
  font-weight: 700;
  color: var(--cm-text);
}

/* Layout - Editorial Grid */
.container {
  max-width: var(--cm-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header */
.site-header {
  background-color: var(--cm-surface);
  border-bottom: 2px solid var(--cm-border);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(20, 21, 26, 0.05);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-branding .site-name {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.5rem;
  color: var(--cm-primary);
  font-weight: 700;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--cm-text);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .site-nav a {
    transition: none;
  }
}

.site-nav a:hover {
  color: var(--cm-secondary);
  border-bottom-color: var(--cm-secondary);
}

.site-nav a:focus-visible {
  outline: 3px solid var(--cm-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Main Content */
main {
  padding: 2.5rem 0;
  min-height: 60vh;
}

.page-intro,
.faq-content,
.about-content {
  background-color: var(--cm-surface);
  border-radius: var(--cm-radius);
  padding: 2.5rem;
  box-shadow: var(--cm-shadow);
  margin-bottom: 2rem;
}

/* Breadcrumbs */
.breadcrumbs {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--cm-muted);
}

.breadcrumbs a {
  color: var(--cm-secondary);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs span[aria-current] {
  color: var(--cm-muted);
}

/* Blockquote Styling */
blockquote {
  margin: 2rem 0;
  padding: 1.5rem;
  border-left: 5px solid var(--cm-accent);
  background-color: rgba(224, 75, 43, 0.05);
  border-radius: 0 var(--cm-radius) var(--cm-radius) 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

.editorial-note {
  font-style: italic;
  color: var(--cm-muted);
}

/* Table Styling - Zebra Rows, Sticky Header, Overflow Handling */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background-color: var(--cm-surface);
  border-radius: var(--cm-radius);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(20, 21, 26, 0.08);
}

table caption {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--cm-primary);
  text-align: left;
  padding: 1rem;
  background-color: var(--cm-bg);
}

thead {
  background-color: var(--cm-primary);
  color: var(--cm-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

thead th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tbody tr {
  border-bottom: 1px solid var(--cm-border);
}

tbody tr:nth-child(even) {
  background-color: rgba(42, 45, 124, 0.03);
}

tbody tr:hover {
  background-color: rgba(15, 107, 110, 0.08);
}

tbody td {
  padding: 1rem;
  color: var(--cm-text);
}

/* Mobile Table Overflow */
@media (max-width: 767px) {
  .page-intro,
  .faq-content,
  .about-content {
    padding: 1.5rem;
  }

  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  thead {
    position: relative;
  }
}

/* Accordion Styling for Details/Summary */
details {
  margin-bottom: 1rem;
  border: 2px solid var(--cm-border);
  border-radius: var(--cm-radius);
  background-color: var(--cm-surface);
  overflow: hidden;
}

summary {
  padding: 1.25rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--cm-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  summary {
    transition: none;
  }
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cm-accent);
  transition: transform 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  summary::after {
    transition: none;
  }
}

details[open] summary::after {
  content: "−";
}

summary:hover {
  background-color: rgba(42, 45, 124, 0.05);
}

summary:focus-visible {
  outline: 3px solid var(--cm-accent);
  outline-offset: -3px;
}

.faq-answer {
  padding: 1.5rem;
  border-top: 1px solid var(--cm-border);
  background-color: rgba(251, 247, 241, 0.5);
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* Aside Styling */
.content-aside {
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: rgba(15, 107, 110, 0.08);
  border-left: 4px solid var(--cm-secondary);
  border-radius: 0 var(--cm-radius) var(--cm-radius) 0;
}

.content-aside h2 {
  font-size: 1.25rem;
  margin-top: 0;
}

/* Footer */
.site-footer {
  background-color: var(--cm-primary);
  color: var(--cm-surface);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.95rem;
}

/* Intro Text Styling */
.intro-text {
  font-size: 1.125rem;
  color: var(--cm-muted);
  margin-bottom: 2rem;
  line-height: 1.8;
}

/* Responsive Typography */
@media (max-width: 767px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .site-branding .site-name {
    font-size: 1.25rem;
  }
}

@media (min-width: 768px) {
  main {
    padding: 3.5rem 0;
  }

  .page-intro,
  .faq-content,
  .about-content {
    padding: 3rem;
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: 2.75rem;
  }

  h2 {
    font-size: 2rem;
  }

  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .site-footer,
  .breadcrumbs,
  .site-nav {
    display: none;
  }

  body {
    background-color: white;
    color: black;
  }

  .page-intro,
  .faq-content,
  .about-content {
    box-shadow: none;
    padding: 0;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  table {
    page-break-inside: avoid;
  }

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

/* Focus Visible for Accessibility */
*:focus-visible {
  outline: 3px solid var(--cm-accent);
  outline-offset: 2px;
}

/* Section Spacing */
section {
  margin-bottom: 3rem;
}

section:last-child {
  margin-bottom: 0;
}

/* FAQ and About Specific Sections */
.faq-accordion {
  margin: 2rem 0;
}

.faq-table-section,
.faq-additional-info {
  margin-top: 3rem;
}

/* Utility: Visually Hidden (for screen readers) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}