:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --text: #1f1d1a;
  --text-muted: #6b645c;
  --accent: #d9381e;       /* Tomato sauce red */
  --accent-hover: #b82c15;
  --border: #e6dfd5;
  --shadow: 0 2px 8px rgba(31, 29, 26, 0.06);
  --radius: 12px;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

main {
  flex: 1;
  padding-bottom: 3rem;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: -0.02em;
}

.brand-tld {
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: #f2ede6;
}

.btn-disabled {
  background: #f2ede6;
  color: #a89f94;
  border-color: var(--border);
  cursor: not-allowed;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
}

/* Intro Banner */
.intro-banner {
  text-align: center;
  padding: 1.5rem 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Responsive Gallery Grid */
.pizza-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.pizza-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.pizza-thumb-btn {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  background: #ebe4da;
  cursor: zoom-in;
  overflow: hidden;
}

.pizza-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.pizza-thumb-btn:hover img {
  transform: scale(1.03);
}

.pizza-meta {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  justify-content: space-between;
}

.pizza-caption {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text);
  word-break: break-word;
}

.pizza-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3.5rem 1.5rem;
  margin-top: 1rem;
}

.empty-state h2 {
  margin-top: 0;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.25rem;
}

.page-indicator {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Lightbox Overlay */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 14, 13, 0.92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-content {
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: 8px;
  object-fit: contain;
}

.lightbox-details {
  text-align: center;
  color: #f5f2ed;
  max-width: 650px;
}

.lightbox-details p {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.lightbox-details span {
  font-size: 0.82rem;
  color: #b5aea4;
}

/* Upload Page */
.upload-container {
  max-width: 560px;
  padding-top: 2rem;
}

.upload-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.upload-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}

.subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.alert-error {
  background: #fdecea;
  color: #9e2212;
  border: 1px solid #f5c2bc;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}

.hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.char-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-input {
  width: 100%;
  padding: 0.65rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.text-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

.text-input:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

/* Pre-upload Preview & Rotation */
.preview-wrapper {
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--bg);
}

.preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  max-height: 300px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.preview-stage img {
  max-width: 240px;
  max-height: 240px;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

.heic-notice {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
}

.rotate-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.rotation-label {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 2.5rem;
  text-align: center;
  color: var(--text-muted);
}

.privacy-notes {
  margin: 1.25rem 0 0;
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.83rem;
}

/* Honeypot concealment */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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