/* Pete White Memorial - peteandmary.com */
/* Bold & Distinguished — Deep navy, white, gold accents */

:root {
  --bg: #ffffff;
  --bg-warm: #f8f7f4;
  --text: #1a1a2e;
  --text-light: #555566;
  --nav-bg: #0d1b2a;
  --nav-text: #e8e6e1;
  --accent: #c9a84c;
  --accent-dark: #a6862e;
  --link: #2a5a8a;
  --border: #d4d0c8;
  --card-bg: #ffffff;
  --max-width: 850px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: normal;
  color: var(--text);
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Navigation */
.nav {
  background: var(--nav-bg);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--accent);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.nav-brand {
  font-family: Georgia, serif;
  color: var(--accent);
  font-size: 1.15rem;
  padding: 0.9rem 0;
  margin-right: 2rem;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.nav-dates {
  display: block;
  font-size: 0.7rem;
  color: rgba(232,230,225,0.4);
  letter-spacing: 0.12em;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  margin-top: -0.1rem;
}

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  color: var(--nav-text);
  padding: 0.9rem 1.2rem;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.75;
  transition: opacity 0.2s;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
  background: rgba(255,255,255,0.06);
}

.nav-comment-btn {
  margin-left: auto;
  padding: 0.45rem 1rem;
  background: var(--accent);
  color: var(--nav-bg);
  border: none;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s;
}

.nav-comment-btn:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

/* Full-width hero with text overlay */
.hero {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--nav-bg);
}

.hero-img {
  display: block;
  width: 100%;
  min-height: 400px;
  max-height: 650px;
  object-fit: cover;
  object-position: center 15%;
  mask-image: linear-gradient(
    to bottom,
    black 0%,
    black 82%,
    rgba(0,0,0,0) 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    black 0%,
    black 82%,
    rgba(0,0,0,0) 100%
  );
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 2.5rem 2rem;
  background: none;
  text-align: center;
}

.hero-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 3rem;
  font-weight: normal;
  color: #ffffff;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.hero-sub {
  font-size: 1.265rem;
  color: rgba(255,255,255,0.9);
  font-style: italic;
  letter-spacing: 0.03em;
  margin-bottom: 0.2rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8), 0 4px 20px rgba(0,0,0,0.5);
}


/* Main content */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* Obituary page */
.obit-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--accent);
}

.obit-header h1 {
  font-size: 2.4rem;
  margin-bottom: 0.3rem;
  color: var(--nav-bg);
  letter-spacing: 0.02em;
}

.obit-dates {
  color: var(--text-light);
  font-size: 1.05rem;
  font-style: italic;
  letter-spacing: 0.03em;
}

.obit-photo-main {
  display: block;
  max-width: 400px;
  margin: 0 auto 2rem;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.obit-text {
  font-size: 1.05rem;
  line-height: 1.85;
}

.obit-text p {
  margin-bottom: 1.3rem;
}

.obit-donation {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.obit-donation-address {
  font-size: 0.95rem;
  color: var(--text-light);
}

.obit-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.obit-photos img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s;
}

.obit-photos img:hover {
  transform: scale(1.02);
}

/* Page headers (non-obit pages) */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--accent);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.page-header h1 {
  font-size: 1.8rem;
  color: var(--nav-bg);
}

/* Comments page */
.comment-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.8rem;
}

.comment-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--nav-bg);
}

.comment-date {
  color: var(--text-light);
  font-size: 0.85rem;
}

.comment-text {
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.comment-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.comment-photos img {
  max-height: 200px;
  max-width: 100%;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s;
  object-fit: cover;
}

.comment-photos img:hover {
  transform: scale(1.03);
}

/* Comment form */
.comment-form {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.comment-form h2 {
  margin-bottom: 1.2rem;
  font-size: 1.4rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg-warm);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.2);
}

.word-count {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.3rem;
}

.word-count.over {
  color: #c0392b;
  font-weight: 600;
}

.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.file-upload-area:hover {
  border-color: var(--accent);
}

.file-upload-area input[type="file"] {
  display: none;
}

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.photo-preview {
  position: relative;
  width: 80px;
  height: 80px;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.photo-preview .remove-photo {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #c0392b;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  background: var(--nav-bg);
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: #162d44;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-danger {
  background: #c0392b;
}

.btn-danger:hover {
  background: #e74c3c;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.form-message {
  padding: 0.8rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  display: none;
}

.form-message.success {
  background: #d4edda;
  color: #155724;
  display: block;
}

.form-message.error {
  background: #f8d7da;
  color: #721c24;
  display: block;
}

/* Album page */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.album-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s;
}

.album-item:hover {
  transform: scale(1.02);
}

.album-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.album-caption {
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  color: var(--text-light);
  background: var(--card-bg);
}

/* Comment Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13,27,42,0.7);
  z-index: 500;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 2rem;
  width: 100%;
  max-width: 600px;
  position: relative;
  margin: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  opacity: 0.8;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 1rem;
  opacity: 0.7;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-prev {
  left: 0.5rem;
}

.lightbox-next {
  right: 0.5rem;
}

.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

/* Admin page */
.admin-login {
  max-width: 400px;
  margin: 3rem auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
}

.admin-login h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.admin-section {
  margin-bottom: 2rem;
}

.admin-section h2 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.admin-comment {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem;
  margin-bottom: 1rem;
}

.admin-comment-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.admin-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.admin-album-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.admin-album-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.admin-album-actions {
  padding: 0.5rem;
  display: flex;
  gap: 0.3rem;
}

/* Loading */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
  font-style: italic;
}

/* Responsive */
@media (max-width: 600px) {
  .nav-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-brand {
    margin-right: 0;
    padding-bottom: 0;
  }

  .nav-links {
    width: 100%;
  }

  .nav-links a {
    padding: 0.7rem 1rem;
    flex: 1;
    text-align: center;
    font-size: 0.8rem;
  }

  .nav-comment-btn {
    width: 100%;
    text-align: center;
    margin: 0 0 0.5rem 0;
    padding: 0.5rem;
  }

  .modal-content {
    padding: 1.5rem;
  }

  .container {
    padding: 1.5rem 1rem 3rem;
  }

  .obit-header h1 {
    font-size: 1.7rem;
  }

  .hero-img {
    min-height: 300px;
  }

  .hero-overlay {
    padding: 1.5rem 1rem;
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-sub {
    font-size: 1.09rem;
  }

  .obit-photos {
    grid-template-columns: 1fr 1fr;
  }

  .album-grid {
    grid-template-columns: 1fr 1fr;
  }

  .comment-meta {
    flex-direction: column;
    gap: 0.2rem;
  }
}
