/**
 * PIrthday.com - Consolidated Modern CSS
 * Replaces: reset.css, text.css, master.css, 960.css, and responsive breakpoint files
 * Uses CSS Custom Properties, Grid/Flexbox, and modern responsive design
 */

/* ==========================================================================
   CSS Custom Properties
   ========================================================================== */

:root {
  /* Colors */
  --color-primary: #0064cd;
  --color-primary-light: #049cdb;
  --color-primary-dark: #003f81;
  --color-secondary: #c60;
  --color-background: #69A8C3;
  --color-text: #333;
  --color-text-light: #666;
  --color-text-muted: #808080;
  --color-white: #fff;
  --color-border: #ccc;
  --color-border-dark: #bbb;

  /* Spacing */
  --spacing-xs: 5px;
  --spacing-sm: 10px;
  --spacing-md: 20px;
  --spacing-lg: 30px;
  --spacing-xl: 50px;

  /* Typography */
  --font-family: 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif;
  --font-size-base: 13px;
  --font-size-small: 11px;
  --line-height: 1.5;

  /* Layout */
  --container-max-width: 960px;
  --container-padding: 10px;
  --footer-height: 50px;

  /* Borders */
  --border-radius: 4px;
  --border-radius-lg: 6px;
  --border-radius-xl: 8px;
}

/* ==========================================================================
   Modern Minimal Reset
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
div,
span,
h1, h2, h3, h4, h5, h6,
p,
blockquote,
pre,
a,
img,
ol,
ul,
li,
form,
label,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
footer,
header,
nav,
section,
figure,
figcaption {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  vertical-align: baseline;
}

html,
body {
  height: 100%;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

b,
strong {
  font-weight: bold;
}

img {
  vertical-align: middle;
  max-width: 100%;
  height: auto;
}

li {
  display: list-item;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

th,
td,
caption {
  font-weight: normal;
  vertical-align: top;
  text-align: left;
}

q {
  quotes: none;
}

q:before,
q:after {
  content: '';
}

sub,
sup,
small {
  font-size: 75%;
}

sub,
sup {
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* ==========================================================================
   Base Typography
   ========================================================================== */

body {
  font: var(--font-size-base)/var(--line-height) var(--font-family);
  background: var(--color-background);
  color: var(--color-text);
}

h1 { font-size: 25px; }
h2 { font-size: 23px; }
h3 { font-size: 21px; }
h4 { font-size: 19px; }
h5 { font-size: 17px; }
h6 { font-size: 15px; }

h1, h2, h3, h4, h5, h6 {
  line-height: 1;
  color: #003366;
}

hr {
  border: 0 var(--color-border) solid;
  border-top-width: 1px;
  clear: both;
  height: 0;
}

ol { list-style: decimal; }
ul { list-style: disc; }

li {
  margin-left: 30px;
}

p,
dl,
hr,
h1, h2, h3, h4, h5, h6,
ol,
ul,
pre,
table,
address,
fieldset,
figure {
  margin-bottom: var(--spacing-md);
}

a {
  color: #003366;
}

a:hover {
  color: #8b4500;
}

small {
  font-size: var(--font-size-small);
}

th {
  font-size: 21px;
  font-weight: bold;
  margin-bottom: var(--spacing-md);
  color: #003366;
}

/* ==========================================================================
   Layout - Container & Grid (replaces 960 Grid System)
   ========================================================================== */

.container,
.container_12 {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--spacing-md);
}

/* Column classes - desktop-first for backwards compatibility */
.col-12,
.grid_12 {
  width: 100%;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.col-2,
.grid_2 {
  width: 100%;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Legacy 960 grid classes - backwards compatibility */
.grid_1,
.grid_3,
.grid_4,
.grid_5,
.grid_6,
.grid_7,
.grid_8,
.grid_9,
.grid_10,
.grid_11 {
  width: 100%;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Prefix/suffix - now use as spacers in modern layout */
.prefix_3,
.prefix_5 {
  padding-left: 0;
}

.suffix_3 {
  padding-right: 0;
}

/* Push/pull - deprecated but keep for backwards compatibility */
.push_5,
.push_7,
.pull_7 {
  position: relative;
}

.alpha {
  padding-left: 0;
}

.omega {
  padding-right: 0;
}

/* Clearfix - modern version */
.clearfix::after,
.container::after,
.container_12::after {
  content: '';
  display: table;
  clear: both;
}

.clear {
  clear: both;
}

/* ==========================================================================
   Page Structure
   ========================================================================== */

#wrapper {
  min-height: 100%;
  padding-bottom: var(--footer-height);
}

body > #wrapper {
  height: auto;
  min-height: 100%;
}

#content {
  overflow: auto;
  padding-bottom: var(--footer-height);
}

#footer {
  text-align: center;
  position: relative;
  margin-top: calc(-1 * var(--footer-height));
  height: var(--footer-height);
  clear: both;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(0, 0, 0, 0.15);
  color: var(--color-text);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.align_center {
  text-align: center;
}

.align_right {
  text-align: right;
}

.margin_top_20 {
  margin-top: var(--spacing-md);
}

.spacer {
  height: var(--spacing-xl);
}

.middly {
  /* Empty in original - placeholder for potential use */
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  cursor: pointer;
  display: inline-block;
  background-color: #e6e6e6;
  background-image: linear-gradient(to bottom, var(--color-white), var(--color-white) 25%, #e6e6e6);
  padding: 5px 14px 6px;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
  font-size: var(--font-size-base);
  line-height: normal;
  border: 1px solid var(--color-border);
  border-bottom-color: var(--color-border-dark);
  border-radius: var(--border-radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: 0.1s linear all;
}

.btn:hover {
  background-position: 0 -15px;
  text-decoration: none;
}

.btn:focus {
  outline: 1px dotted #666;
}

.btn.primary {
  color: var(--color-white);
  background-color: var(--color-primary);
  background-image: linear-gradient(to bottom, var(--color-primary-light), var(--color-primary));
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
  border-color: var(--color-primary);
  border-bottom-color: var(--color-primary-dark);
}

.btn.active,
.btn:active {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn.large {
  font-size: 15px;
  line-height: normal;
  padding: 9px 14px 9px;
  border-radius: var(--border-radius-lg);
}

/* ==========================================================================
   Forms
   ========================================================================== */

select {
  height: 27px;
  line-height: 27px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text-muted);
  display: inline-block;
  font-size: var(--font-size-base);
  padding: 4px;
  width: 210px;
  margin: 0;
  vertical-align: baseline;
}

select.mini,
input.mini {
  width: 70px;
}

/* ==========================================================================
   Tables (Past/Next/Future PIrthdays)
   ========================================================================== */

/* Happy page table layout - three columns centered */
.pirthday-tables {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.pirthday-tables .table-column {
  min-width: 120px;
}

table.past,
table.future,
table.next {
  display: none;
}

table.next {
  text-align: center;
  width: 100%;
}

table.next th {
  text-align: center;
}

table.next td {
  text-align: center;
  width: 80px;
}

table.next td:first-child {
  width: 50px;
}

table.past {
  width: 100%;
}

table.past th {
  text-align: right;
}

table.past td {
  text-align: right;
  width: 50px;
}

table.past td:first-child {
  width: 100px;
}

table.future {
  width: 100%;
}

table.future td:first-child {
  text-align: right;
  width: 70px;
  padding-right: var(--spacing-md);
}

/* ==========================================================================
   Page-Specific Styles
   ========================================================================== */

/* Index page - Happy birthday message */
div#happy {
  display: none;
  font-size: 16pt;
}

span.curr {
  font-weight: bold;
  font-size: 24pt;
}

/* Baby page - Countdown */
span#countdown1 {
  font-size: 64pt;
}

div#cntdownexpl {
  font-size: 24pt;
}

/* Bold links */
a.boldish {
  font-weight: bold;
  font-size: 13pt;
}

/* Network links */
div#network {
  position: fixed;
  top: 1em;
  left: 1em;
  z-index: 100;
}

/* Social plugins */
div#socialplugins {
  position: fixed;
  top: 1em;
  right: 1em;
  z-index: 100;
}

iframe.twitter-share-button {
  position: relative;
  top: 3px;
}

/* Greetings section */
#greetings {
  max-width: 600px;
  margin: 0 auto;
  padding-top: var(--spacing-md);
  border-top: 2px solid rgba(0, 0, 0, 0.15);
}

#greetings h1,
#greetings h2 {
  margin-top: var(--spacing-md);
  color: #003366;
}

#greetings ul {
  text-align: left;
  display: inline-block;
}

/* ==========================================================================
   Blog Styles - Seamless Blue Design
   ========================================================================== */

.blog-list {
  list-style: none;
  padding: 0;
  margin: var(--spacing-md) 0;
}

.blog-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  padding: var(--spacing-md) 0;
  margin-bottom: 0;
  margin-left: 0;
}

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

.blog-item h2 {
  margin: 0 0 var(--spacing-sm) 0;
  font-size: 1.4em;
}

.blog-item h2 a {
  color: #003366;
  text-decoration: none;
}

.blog-item h2 a:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

.blog-date {
  color: #1a4a6e;
  font-size: 0.9em;
  margin-bottom: var(--spacing-sm);
  font-style: italic;
}

.blog-excerpt {
  color: var(--color-text);
  line-height: 1.6;
}

.read-more {
  display: inline-block;
  margin-top: var(--spacing-sm);
  color: #003366;
  font-weight: bold;
}

.read-more:hover {
  color: var(--color-secondary);
}

.blog-header {
  padding: var(--spacing-md) 0;
  margin-bottom: var(--spacing-md);
  text-align: center;
  border-bottom: 2px solid rgba(0, 0, 0, 0.15);
}

.blog-header h1 {
  color: #003366;
  margin: 0;
}

.blog-header p {
  color: var(--color-text);
  margin: var(--spacing-sm) 0 0 0;
}

.back-link {
  display: inline-block;
  margin-bottom: var(--spacing-md);
  color: #003366;
}

.back-link:hover {
  color: var(--color-secondary);
}

/* Article styles - seamless */
.article-content {
  padding: var(--spacing-md) 0;
  margin-bottom: var(--spacing-md);
  line-height: 1.8;
  border-top: 2px solid rgba(0, 0, 0, 0.15);
}

.article-content h1 {
  color: #003366;
  margin: 0 0 var(--spacing-sm) 0;
  font-size: 1.8em;
}

.article-content h2 {
  color: #003366;
  margin: var(--spacing-lg) 0 15px 0;
  font-size: 1.4em;
  padding-top: var(--spacing-sm);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.article-content h2:first-child {
  border-top: none;
  padding-top: 0;
}

.article-content h3 {
  color: #1a4a6e;
  margin: 25px 0 var(--spacing-sm) 0;
  font-size: 1.2em;
}

.article-meta {
  color: #1a4a6e;
  font-size: 0.9em;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  font-style: italic;
}

.article-content p {
  margin: 0 0 15px 0;
  color: var(--color-text);
}

.article-content ul,
.article-content ol {
  margin: 0 0 15px var(--spacing-md);
  color: var(--color-text);
}

.article-content li {
  margin-bottom: 8px;
}

/* Highlight boxes - tinted blue instead of white */
.highlight-box {
  background: rgba(0, 51, 102, 0.15);
  border-left: 4px solid #003366;
  padding: 15px var(--spacing-md);
  margin: var(--spacing-md) 0;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.highlight-box strong {
  color: #003366;
}

/* CTA boxes - tinted */
.cta-box {
  background: rgba(0, 80, 60, 0.2);
  border: 1px solid rgba(0, 80, 60, 0.3);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  text-align: center;
}

.cta-box a {
  color: #003366;
  font-weight: bold;
}

/* Related posts - subtle separator */
.related-posts {
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.related-posts h3 {
  margin: 0 0 15px 0;
  color: #003366;
}

.related-posts ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-posts li {
  margin-bottom: var(--spacing-sm);
  margin-left: 0;
}

.related-posts a {
  color: #003366;
}

.related-posts a:hover {
  color: var(--color-secondary);
}

/* Celebrity cards */
.celebrity-card {
  background: rgba(0, 51, 102, 0.12);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
  border-left: 4px solid #003366;
}

.celebrity-card h3 {
  margin: 0 0 var(--spacing-sm) 0;
  color: #003366;
}

.celebrity-card .birthdate {
  font-weight: bold;
  color: #1a4a6e;
}

.celebrity-card ul {
  margin: var(--spacing-sm) 0 0 var(--spacing-md);
}

/* Formula boxes - keep dark for contrast */
.formula-box {
  background: #1a1a2e;
  color: var(--color-white);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
  font-family: 'Courier New', monospace;
  text-align: center;
  font-size: 1.1em;
}

.formula-box .formula {
  color: #4fc3f7;
  font-size: 1.3em;
  margin: var(--spacing-sm) 0;
}

.formula-box pre {
  text-align: left;
  overflow-x: auto;
  margin: 0;
  color: var(--color-white);
}

/* Example boxes */
.example-box {
  background: rgba(0, 0, 0, 0.08);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.example-box h4 {
  margin: 0 0 15px 0;
  color: #003366;
}

.step {
  background: rgba(255, 255, 255, 0.3);
  border-left: 3px solid #003366;
  padding: var(--spacing-sm) 15px;
  margin: var(--spacing-sm) 0;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.step strong {
  color: #003366;
}

/* Math table - seamless */
table.math-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-md) 0;
}

table.math-table th,
table.math-table td {
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 12px;
  text-align: left;
}

table.math-table th {
  background: #003366;
  color: var(--color-white);
}

table.math-table tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.06);
}

/* Timeline */
.timeline {
  border-left: 3px solid #003366;
  padding-left: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.timeline-item {
  position: relative;
  margin-bottom: 25px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 5px;
  width: 12px;
  height: 12px;
  background: #003366;
  border-radius: 50%;
}

.timeline-item h4 {
  margin: 0 0 5px 0;
  color: #003366;
}

.timeline-item p {
  margin: 0;
}

/* Celebration boxes */
.celebration-box {
  background: rgba(200, 100, 0, 0.15);
  border: 1px solid rgba(200, 100, 0, 0.3);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin: var(--spacing-md) 0;
}

.celebration-box h4 {
  margin: 0 0 var(--spacing-sm) 0;
  color: #8b4500;
}

/* Fact cards - keep colorful gradients */
.fact-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--color-white);
  border-radius: 12px;
  padding: 25px;
  margin: var(--spacing-md) 0;
}

.fact-card h3 {
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--color-white);
  font-size: 1.3em;
}

.fact-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
}

.fact-card.green {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.fact-card.orange {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.fact-card.blue {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.fact-card.dark {
  background: linear-gradient(135deg, #232526 0%, #414345 100%);
}

.number-highlight {
  font-size: 2em;
  font-weight: bold;
  display: block;
  margin: var(--spacing-sm) 0;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Tablet: 768px - 1024px */
@media (max-width: 1024px) {
  :root {
    --container-max-width: 720px;
  }

  span#countdown1 {
    font-size: 48pt;
  }

  div#cntdownexpl {
    font-size: 18pt;
  }

  div#network,
  div#socialplugins {
    position: static;
    text-align: center;
    margin-bottom: var(--spacing-sm);
  }
}

/* Mobile: < 768px */
@media (max-width: 767px) {
  :root {
    --container-max-width: 100%;
    --spacing-md: 15px;
    --spacing-lg: 20px;
  }

  body {
    font-size: 14px;
  }

  h1 { font-size: 22px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }
  h4 { font-size: 16px; }
  h5 { font-size: 15px; }
  h6 { font-size: 14px; }

  .container,
  .container_12 {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Stack columns on mobile */
  .grid_2,
  .grid_3,
  .grid_4,
  .grid_5,
  .grid_6,
  .grid_7,
  .grid_8,
  .grid_9,
  .grid_10,
  .grid_11,
  .grid_12 {
    padding-left: 0;
    padding-right: 0;
  }

  /* Reset prefix/suffix on mobile */
  .prefix_3,
  .prefix_5,
  .suffix_3 {
    padding-left: 0;
    padding-right: 0;
  }

  /* Reset push/pull on mobile */
  .push_5,
  .push_7,
  .pull_7 {
    left: 0;
  }

  /* Form elements */
  select {
    width: 100%;
    max-width: 210px;
  }

  select.mini,
  input.mini {
    width: 70px;
    max-width: 70px;
  }

  /* Button adjustments */
  .btn {
    padding: 8px 16px;
  }

  .btn.large {
    padding: 10px 16px;
    font-size: 14px;
  }

  /* Baby page countdown */
  span#countdown1 {
    font-size: 32pt;
    word-break: break-all;
  }

  div#cntdownexpl {
    font-size: 14pt;
  }

  /* Index page - current age */
  span.curr {
    font-size: 18pt;
  }

  div#happy {
    font-size: 14pt;
  }

  /* Social/network - stack on mobile */
  div#network,
  div#socialplugins {
    position: static;
    text-align: center;
    margin-bottom: var(--spacing-sm);
  }

  /* Tables */
  table.next td,
  table.past td,
  table.future td {
    width: auto;
    padding: 5px;
  }

  /* Happy page - stack tables on mobile */
  .pirthday-tables {
    flex-direction: column;
    align-items: center;
  }

  .pirthday-tables .table-column {
    text-align: center;
    margin-bottom: var(--spacing-sm);
  }

  th {
    font-size: 18px;
  }

  /* Greetings */
  #greetings {
    padding: 0 var(--spacing-sm);
  }

  #greetings ul {
    padding-left: var(--spacing-md);
  }

  /* Article content */
  .article-content {
    padding: var(--spacing-md);
  }

  .article-content h1 {
    font-size: 1.5em;
  }

  .article-content h2 {
    font-size: 1.25em;
  }

  /* Formula box adjustments */
  .formula-box {
    font-size: 0.9em;
    padding: 15px;
  }

  .formula-box .formula {
    font-size: 1.1em;
  }

  /* Fact cards */
  .fact-card {
    padding: var(--spacing-md);
  }

  .number-highlight {
    font-size: 1.5em;
  }

  /* Footer */
  #footer {
    padding: var(--spacing-sm);
    height: auto;
    min-height: var(--footer-height);
  }

  #wrapper {
    padding-bottom: 60px;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  span#countdown1 {
    font-size: 24pt;
  }

  div#cntdownexpl {
    font-size: 12pt;
  }

  .formula-box .formula {
    font-size: 1em;
  }
}
