/* Generated stylesheet for foamcraft.org */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --primary:   #4a1942;
  --accent:    #f4a261;
  --text:      #222222;
  --muted:     #666666;
  --bg:        #ffffff;
  --surface:   #f6f6f6;
  --border:    #dddddd;
  --radius:    4px;
  --max-width: 960px;
  --font-head: 'Palatino Linotype', Palatino, serif;
  --font-body: 'Arial', Helvetica, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

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

/* ── Layout ──────────────────────────────── */
.site-wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }

/* ── Header / nav ────────────────────────── */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 0;
}

.site-header .site-wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.site-title {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}
.site-title:hover { color: var(--accent); }

.site-tagline {
  font-size: 0.85rem;
  opacity: 0.75;
  flex: 1;
  min-width: 0;
}

.site-nav {
  background: color-mix(in srgb, var(--primary) 80%, black);
  border-bottom: 2px solid var(--accent);
}

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

.site-nav a {
  display: inline-block;
  padding: 0.55rem 0.9rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.875rem;
  border-right: 1px solid rgba(255,255,255,0.1);
  transition: background 0.15s, color 0.15s;
}
.site-nav a:hover,
.site-nav a.active { background: var(--accent); color: #fff; }

/* ── Main content ────────────────────────── */
.site-main { padding: 2.5rem 0 3rem; }

/* ── Typography ──────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--primary);
  line-height: 1.25;
  margin-top: 1.75em;
  margin-bottom: 0.4em;
}
h1 { font-size: 2rem; margin-top: 0; border-bottom: 3px solid var(--accent); padding-bottom: 0.3em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }

ul, ol { padding-left: 1.5em; margin: 0 0 1.1em; }
li { margin-bottom: 0.3em; }

blockquote {
  border-left: 4px solid var(--accent);
  margin: 1.5em 0;
  padding: 0.75em 1.25em;
  background: var(--surface);
  border-radius: var(--radius);
  color: var(--muted);
  font-style: italic;
}

code {
  font-family: 'Courier New', Courier, monospace;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1em 1.25em;
  overflow-x: auto;
}
pre code { background: none; border: none; padding: 0; }

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5em 0;
  font-size: 0.95em;
}
th, td { padding: 0.6em 0.85em; border: 1px solid var(--border); text-align: left; }
th { background: var(--primary); color: #fff; font-family: var(--font-head); }
tr:nth-child(even) td { background: var(--surface); }

/* ── Images ──────────────────────────────── */
figure.page-image {
  margin: 1.75em 0;
  text-align: center;
}
figure.page-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
figcaption {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.4em;
  font-style: italic;
}
.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1em;
}

/* ── Page card grid (index) ──────────────── */
.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.page-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  transition: box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}
.page-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.09);
  border-color: var(--accent);
}
.page-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5em;
  color: var(--primary);
}
.page-card p {
  font-size: 0.875rem;
  color: var(--muted);
  flex: 1;
  margin: 0 0 0.85em;
}
.page-card a.read-more {
  font-size: 0.8rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--accent);
}
.page-card a.read-more:hover { text-decoration: underline; }

/* ── Site description block ──────────────── */
.site-description {
  background: var(--surface);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 2rem;
  font-size: 1.025rem;
  color: var(--muted);
}

/* ── Footer ──────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* ── Ad units ────────────────────────────── */
.ad-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
}

.ad-unit {
  width: 100%;
  overflow: hidden;
}

/* Placeholder shown when no AdSense publisher ID is configured */
.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-height: 90px;
  margin: 0.5rem 0;
}

.ad-placeholder span { opacity: 0.5; }

.ad-in-content {
  margin: 1.75em 0;
  text-align: center;
}

/* ── Content + sidebar layout ────────────── */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  align-items: start;
}

.sidebar {
  min-width: 0;
}

.sidebar-sticky {
  position: sticky;
  top: 1.5rem;
}

.ad-sidebar .ad-placeholder {
  min-height: 250px;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
  .sidebar { order: -1; }        /* Sidebar ad above content on mobile */
  .sidebar-sticky { position: static; }
}

@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .site-header .site-wrap { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .site-tagline { display: none; }
  .ad-placeholder { min-height: 60px; }
}