body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

header {
    background: #35424a;
    color: #ffffff;
    padding: 10px 0;
    text-align: center;
}

/* Navbar styling */
.navbar { background: #ffffff; border-bottom: 1px solid #e6e6e6; }
.nav-inner { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.nav-brand .nav-link { font-weight:700; color:#333; text-decoration:none; font-size:1.05rem; }
.nav-list { list-style:none; margin:0; padding:6px 0; display:flex; gap:10px; align-items:center; }
.nav-item { }
.nav-link { color:#444; text-decoration:none; padding:8px 10px; border-radius:6px; display:inline-block; }
.nav-link:hover { background:#f0f0f0; color:#111; }

/* Mobile nav adjustments */
@media (max-width:640px) {
    .nav-inner { flex-direction:column; align-items:flex-start; padding:8px 12px; }
    .nav-list { flex-wrap:wrap; }
}

/* Hero section: center person and photo */
.hero { display:flex; align-items:center; justify-content:center; text-align:center; min-height:40vh; padding:40px 0; }
.hero .container { display:flex; flex-direction:column; align-items:center; gap:18px; }
.hero h1 { font-size:2.2rem; margin:0; }

/* Hero grid: left - center - right */
.hero-grid { display:flex; align-items:center; justify-content:center; gap:18px; width:100%; }
.hero-side { width:18%; display:flex; flex-direction:column; gap:8px; align-items:center; }
.hero-side-img { max-width:100%; max-height:160px; border-radius:8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); cursor:pointer; }
.hero-center { width:44%; display:flex; align-items:center; justify-content:center; }
.hero-main { max-width:100%; max-height:260px; border-radius:8px; box-shadow: 0 6px 20px rgba(0,0,0,0.12); cursor:zoom-in; }
.hero-placeholder { display:inline-block;width:300px;height:180px;border-radius:6px;background:#f0f0f0;line-height:180px;color:#666; }

@media (max-width:900px) {
    .hero-grid { flex-direction:column; }
    .hero-side { width:100%; flex-direction:row; justify-content:center; gap:10px; }
    .hero-center { width:100%; }
    .hero-main { max-height:220px; }
}

/* When there are no side images, limit main hero height to half the viewport */
.hero-grid.hero-only .hero-main {
    max-height:50vh;
}
.hero p.lead { margin:0; color:#555; font-size:1rem; }

h1 {
    margin: 0;
    font-size: 2.5em;
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
}

form {
    background: #ffffff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

form input[type="text"],
form input[type="email"],
form input[type="file"],
form input[type="submit"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Message textarea styling */
form textarea {
    width: 100%;
    min-height: 140px;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1.4;
    resize: vertical;
}

form input[type="submit"] {
    background: #35424a;
    color: #ffffff;
    border: none;
    cursor: pointer;
}

form input[type="submit"]:hover {
    background: #45a049;
}

footer {
    text-align: center;
    padding: 20px;
    background: #35424a;
    color: #ffffff;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* Upload preview and progress */
#upload-box { display:flex; align-items:center; gap:8px; }
#upload-progress { width: 100%; max-width:360px; }
#upload-progress-bar { width:0; height:10px; background:#4caf50; border-radius:4px; transition:width .2s; }
#photo-preview img { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

.entries-section { margin-top: 28px; }
.entries-grid {
    /* Use CSS Columns to create a masonry-like, jumbled layout where each
       entry's height depends on its content (photos + message) rather than
       forcing uniform row heights. */
    column-count: 3;
    column-gap: 18px;
    margin-top: 12px;
}
.entry {
    display: inline-block; /* required for column flow */
    width: 100%;
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    margin: 0 0 18px; /* vertical gutter */
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    -moz-column-break-inside: avoid;
    box-sizing: border-box;
}
.entry-photos { display:flex; gap:10px; flex-wrap:wrap; align-items:flex-start; }
.entry-photo { width:100%; max-width:100%; display:flex; flex-direction:column; align-items:flex-start; }
.entry-photo img { max-width:100%; height:auto; border-radius:6px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); cursor:default; }
.entry-caption { margin-top:6px; font-size:0.95rem; color:#333; }
.entry-message { margin-top:10px; font-size:1rem; color:#222; }
.entry-author { margin-top:8px; font-size:0.9rem; color:#666; }

/* Message-only bubble style */
.entry-bubble { background: linear-gradient(180deg,#fff 0%,#fbfbfb 100%); border:1px solid #e6e6e6; padding:14px; border-radius:18px; }
.entry-bubble .entry-message { white-space:pre-wrap; }

/* Hover tooltip handled via title attribute on img (native). For nicer look, we keep default browser tooltip. */

@media (max-width:1100px) {
    .entries-grid { column-count: 2; }
}

@media (max-width:600px) {
    .container { width:95%; }
    .entries-grid { column-count: 1; }
}

/* Buttons */
.btn { display:inline-block; background:#35424a; color:#fff; padding:10px 16px; border-radius:6px; text-decoration:none; }
.btn:hover { background:#2b3a40; }

/* Footer link accent color for better contrast and visibility */
.site-footer a { color: #ffd166; text-decoration: underline; }
.site-footer a:hover { color: #ffffff; text-decoration: none; }

/* Lightbox styles */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease-in-out;
}
.lightbox-overlay.open { opacity: 1; pointer-events: auto; }
.lightbox-content { max-width: 95%; max-height: 85vh; display:flex; flex-direction:column; align-items:center; gap:12px; }
.lightbox-content img { max-width: 100%; max-height: calc(85vh - 60px); width: auto; height: auto; border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,0.6); }
.lightbox-caption { color:#ddd; font-size:0.95rem; text-align:center; max-width:90%; }
.lightbox-close { position: absolute; top: 18px; right: 18px; color: #fff; background: rgba(0,0,0,0.4); border-radius: 6px; padding:6px 8px; cursor:pointer; font-size:18px; }

/* Heart button */
.entry-actions { margin-top:8px; }
.heart-btn { background: transparent; border: none; color: #888; font-size: 1rem; cursor: pointer; padding:6px 8px; border-radius:6px; display:inline-flex; align-items:center; gap:8px; }
.heart-btn:hover { background:#f6f6f6; color:#c0392b; }
.heart-btn.hearted { color: #c0392b; font-weight:700; }
.heart-count { font-weight:600; margin-left:6px; }

/* Pop animation when heart toggles */
.heart-btn.popping { animation: heart-pop 280ms cubic-bezier(.2,.8,.2,1); }
.heart-count.pulse { animation: count-pulse 360ms cubic-bezier(.2,.8,.2,1); display:inline-block; }

@keyframes heart-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    65% { transform: scale(0.95); }
 100% { transform: scale(1); }
}

@keyframes count-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.95; }
 100% { transform: scale(1); opacity: 1; }
}
/* No JS masonry styles — using CSS grid layout for entries */