/*
 * Spanish Wine Scholar — Revision Sheet Styles
 * Shared CSS with CSS Custom Properties for theming
 *
 * Usage: Define these CSS variables in each HTML file:
 *   --theme-primary: Main brand color
 *   --theme-dark: Darker shade for gradients
 *   --theme-highlight: Light accent for exam item headers
 *
 * Color Themes by Region:
 * -----------------------
 * Galicia:            #1e5631, #2d7a46, #90EE90
 * Rioja:              #722F37, #8B0000, #FFB6C1
 * Navarra:            #C41E3A, #8B0000, #FFB6C1
 * Aragón:             #D4A017, #8B4513, #FFE4B5
 * Castilla y León:    #8B4513, #654321, #FFD700
 * País Vasco:         #228B22, #006400, #90EE90
 * Asturias y Cantabria: #2E8B57, #006666, #98FB98
 * Cataluña:           #722F37, #4A1C2A, #FFB6C1
 * Valencia:           #E65100, #BF360C, #FFCC80
 * Andalucía:          #D4AF37, #996515, #FFF8DC
 * Castilla-La Mancha: #8B7355, #5D4E37, #DEB887
 * Murcia:             #6B3FA0, #4A235A, #DDA0DD
 * Canary Islands:     #1E3A5F, #0D2137, #87CEEB
 * Extremadura:        #A0522D, #6B3A1F, #F4A460
 * Madrid:             #1E3A8A, #1E1E5A, #93C5FD
 * Balearic Islands:   #008B8B, #006666, #7FFFD4
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Source+Sans+3:wght@400;600;700&display=swap');

/* Reset & Page Setup */
* { margin: 0; padding: 0; box-sizing: border-box; }
@page { size: letter; margin: 8mm; }

/* Base Typography */
body {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 7.5pt;
  line-height: 1.25;
  color: #1a1a1a;
  background: white;
  max-width: 8.5in;
  margin: 0 auto;
  padding: 0.3in;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-dark) 100%);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 20pt;
}
.header .subtitle {
  font-size: 8pt;
  opacity: 0.9;
}
.header .badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 50%;
}
.header .badge {
  background: rgba(255,255,255,0.2);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 6.5pt;
  font-weight: 600;
}

/* Main Grid - 3 columns */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

/* Sections */
.section {
  background: #f8f9fa;
  border-radius: 5px;
  padding: 6px 8px;
  border-left: 3px solid var(--theme-primary);
}
.section h2 {
  font-size: 8pt;
  color: var(--theme-primary);
  margin-bottom: 4px;
  border-bottom: 1px solid #ddd;
  padding-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.section h3 {
  font-size: 7pt;
  color: #333;
  margin: 4px 0 2px 0;
  text-transform: uppercase;
}

/* Key Facts Box */
.key-box {
  background: #fff8e7;
  border: 1px solid #e8c84a;
  border-radius: 4px;
  padding: 6px 8px;
  margin-bottom: 6px;
  grid-column: 1 / -1;
}
.key-box h2 {
  font-size: 8pt;
  color: #8b6914;
  margin-bottom: 4px;
}
.key-box .grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 4px 12px;
}
.key-box .item {
  font-size: 7pt;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 6.5pt;
  margin: 3px 0;
}
th, td {
  padding: 2px 4px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}
th {
  background: #e9ecef;
  font-weight: 600;
  font-size: 6pt;
  text-transform: uppercase;
  color: #495057;
}
tr:last-child td {
  border-bottom: none;
}

/* Grape Tags */
.grape {
  display: inline-block;
  padding: 0px 4px;
  border-radius: 2px;
  font-size: 6pt;
  font-weight: 600;
  margin: 1px 0;
}
.grape-w {
  background: #d4edda;
  color: #155724;
}
.grape-r {
  background: #f8d7da;
  color: #721c24;
}

/* Layout Utilities */
.full-width {
  grid-column: 1 / -1;
}
.span-2 {
  grid-column: span 2;
}

/* Exam Box */
.exam-box {
  background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-dark) 100%);
  color: white;
  border-radius: 5px;
  padding: 6px 8px;
}
.exam-box h2 {
  color: white;
  border-bottom-color: rgba(255,255,255,0.3);
  font-size: 8pt;
  margin-bottom: 4px;
}
.exam-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.exam-item {
  background: rgba(255,255,255,0.12);
  padding: 4px 6px;
  border-radius: 3px;
  font-size: 6.5pt;
}
.exam-item strong {
  display: block;
  font-size: 7pt;
  color: var(--theme-highlight);
}

/* Strong text uses theme color */
strong {
  color: var(--theme-primary);
}

/* Footer */
.footer {
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid #ddd;
  font-size: 6pt;
  color: #666;
  text-align: center;
}

/* Lists */
ul {
  margin: 0;
  padding-left: 12px;
}
li {
  margin-bottom: 1px;
}

/* Timeline (used in some sheets) */
.timeline {
  font-size: 6.5pt;
}
.timeline .year {
  font-weight: 700;
  color: var(--theme-primary);
  display: inline-block;
  width: 55px;
}

/* DO/Zone boxes (used in some sheets) */
.zone-box, .do-box {
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 6px;
  margin: 3px 0;
}
.zone-box .name, .do-box .name {
  font-weight: 700;
  color: var(--theme-primary);
  font-size: 7.5pt;
}
