:root {
  --accent: #00838f;
  --bg: #fafafa;
  --text: #222;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.5 'Lucida Grande',
    Helvetica,
    Arial,
    sans-serif;
  /* Keep the footer pinned to the bottom of short pages. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

footer.site-footer {
  /* margin-top: auto pushes it down; negative sides span the body padding. */
  margin: auto -2rem -2rem;
  padding: 0.35rem 2rem;
  border-top: 1px solid #ddd;
  background: #f0f0f0;
  color: #666;
  font-size: 0.8rem;
  text-align: center;
}

header {
  margin-bottom: 1.5rem;
}

/* Bodegameow-style menu: a plain wrapping row of emoji + label links. */
nav.auth {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  min-height: 2rem;
  margin-bottom: 1rem;
  font-size: 14px;
}

nav.auth a {
  color: inherit;
  text-decoration: none;
}

nav.auth a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  /* Keep the footer spanning the (smaller) body padding. */
  footer.site-footer {
    margin: auto -1rem -1rem;
    padding: 0.35rem 1rem;
  }
}

nav.auth .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

nav.auth .signed-in {
  color: #666;
}

/* The sign-out form button, dressed as one of the links. */
nav.auth .link-button {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

nav.auth .link-button:hover {
  text-decoration: underline;
}

h1 {
  margin: 0 0 0.25rem;
  color: var(--accent);
}

a {
  color: var(--accent);
}

button {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.1);
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* "Show another cat" and "Add a cat" share one size: 186×44px, a φ³
   rectangle (the golden ratio cubed ≈ 4.236 — the same proportion Fibonacci
   numbers three apart have, e.g. 144:34). */
.actions button,
.actions a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 186px;
  height: 44px;
  margin-top: 0;
  padding: 0 0.75rem;
  text-align: center;
}

/* Link styled like the buttons beside it. */
a.button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

a.button:hover {
  filter: brightness(1.1);
}

.notice {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: #e0f2f1;
  border: 1px solid var(--accent);
}

.error {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: #fdecea;
  border: 1px solid #c0392b;
  color: #c0392b;
}

.hint {
  color: #666;
  font-size: 0.9rem;
}

.cat {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

figure {
  margin: 0;
}

figure img {
  display: block;
  width: 400px;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  /* sharp auto-orients thumbnails, but keep this as a fallback for full-size links */
  image-orientation: from-image;
}

figcaption {
  margin-top: 0.5rem;
  color: #666;
  font-size: 0.9rem;
}

#map {
  width: 400px;
  height: 400px;
  max-width: 100%;
  border-radius: 8px;
}

/* Favorites star (sits next to the photo caption). */
figcaption {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.star-form {
  display: inline;
}

button.star {
  margin: 0;
  padding: 0 0.25rem;
  background: none;
  color: #f0a500;
  font-size: 1.4rem;
  line-height: 1;
}

button.star:hover {
  filter: none;
  transform: scale(1.15);
}

/* Photo grids (favorites / my photos / admin). */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.photo-card img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
}

.photo-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.photo-name {
  color: #666;
  overflow-wrap: anywhere;
}

/* Edit page. */
section {
  margin: 1.5rem 0;
  max-width: 480px;
}

section h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: var(--accent);
}

section label {
  display: block;
  margin: 0.5rem 0;
}

section input[type='number'] {
  width: 12rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

button.secondary {
  background: #e0e0e0;
  color: var(--text);
}

button.danger {
  background: #c0392b;
}

/* Business association. */
.place-line {
  margin: 0.35rem 0 0;
  color: #666;
  font-size: 0.9rem;
}

.place-search {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0;
}

.place-search input[type='search'] {
  flex: 1;
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.place-search button {
  margin-top: 0;
  white-space: nowrap;
}

#place-results {
  margin: 0.5rem 0;
}

.place-option {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.3rem 0.25rem;
  border-radius: 6px;
  cursor: pointer;
}

.place-option:hover {
  background: #eee;
}

/* Places directory. */
ul.places-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.places-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #eee;
}

/* Account page. */
.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
}

label.checkbox {
  display: block;
  margin: 0.35rem 0;
}

section input[type='text'] {
  display: block;
  width: 100%;
  max-width: 20rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

/* Cat map page. */
.map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.map-controls input[type='search'] {
  flex: 1;
  min-width: 12rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.map-controls button {
  margin-top: 0;
  white-space: nowrap;
}

#bigmap {
  width: 100%;
  height: 70vh;
  border-radius: 8px;
}

.geo-option {
  display: block;
  margin: 0.25rem 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

#places-map {
  width: 100%;
  height: 50vh;
  margin-bottom: 1rem;
  border-radius: 8px;
}

/* Cat profile pages. */
.cat-portrait {
  width: 240px;
  max-width: 100%;
  border-radius: 8px;
}

.picture-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.picture-option {
  cursor: pointer;
}

.picture-option img {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  border: 3px solid transparent;
}

.picture-option input[type='radio'] {
  position: absolute;
  opacity: 0;
}

.picture-option input[type='radio']:checked + img {
  border-color: var(--accent);
}

section select {
  display: block;
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
}

/* Videos, shown wherever photos are. */
figure video {
  display: block;
  width: 400px;
  max-width: 100%;
  border-radius: 8px;
}

.photo-card video {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  pointer-events: none; /* the card's link handles the click */
}

h2.grid-heading {
  margin: 1.5rem 0 0.25rem;
  font-size: 1.1rem;
  color: var(--accent);
}

/* A button dressed as an inline link (e.g. "how far away is this cat?"). */
button.inline-link {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Comments. */
.comment {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.comment-meta {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.85rem;
}

.comment-author {
  font-weight: bold;
}

.comment-body {
  margin: 0.15rem 0 0;
  white-space: pre-line; /* keep the author's line breaks */
  overflow-wrap: anywhere;
}

.inline-form {
  display: inline;
}

section textarea {
  display: block;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font: inherit;
  resize: vertical;
}

/* Reporting. */
.report-details summary {
  color: var(--accent);
  cursor: pointer;
}

.report-details form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.report-details input[type='text'] {
  flex: 1;
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
}

.report-details button {
  margin-top: 0;
}

.report-target {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 0.35rem 0;
}

/* Share rows (bodegameow-style: actions, then muted network links). */
.share-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.share-networks {
  display: flex;
  gap: 10px;
  margin: 0.25rem 0 0;
  font-size: 13px;
}

.share-networks a {
  color: #888;
  text-decoration: none;
}

.share-networks a:hover {
  text-decoration: underline;
}
