:root {
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --transition-ease: 0.3s;
}

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

body {
  background-color: #1c1c1a;
  color: #e2e0d2;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  color: #fff;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  font-weight: 600;
}

header {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: #242420;
  box-shadow: 0 4px 18px #0002;
  transition: background 0.3s;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 155px;
  margin-bottom: 0;
}

/* Header Branding */
.branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0.7rem;
  padding: 1.3rem 0 0.2rem 0;
}

.logo {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  background-color: transparent;
  border: none;
  box-shadow: none;
  transition: transform 0.2s;
  cursor: pointer;
}
.logo:hover {
  transform: scale(1.05);
}
.title-text {
  text-align: center;
  width: 100%;
}
.title-text h1 {
  margin: 0;
  font-size: 2.3em;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.title-text p {
  margin: 0.3em 0 0.1em;
  font-size: 1.08em;
  color: #aaa;
  font-weight: 300;
  line-height: 1.1;
}

/* Navigation */
nav {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.3rem;
  margin-top: 0.3rem;
  margin-bottom: 0.5rem;
  padding: 0;
}
nav a {
  font-size: 1.13em;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #85b58a;
  text-decoration: none;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  transition: color 0.2s, background-color 0.2s;
  background: transparent;
  display: inline-block;
}
nav a:hover,
nav a.active {
  color: #f4d35e;
  background-color: rgba(255,255,255,0.05);
}

/* Auth Links (login/logout) */
.auth-links {
  padding: var(--spacing-xs) var(--spacing-sm);
}
.auth-links a {
  text-decoration: none;
  font-weight: bold;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  transition: color var(--transition-ease), background-color var(--transition-ease);
  display: inline-block;
}
.auth-links a:hover {
  background-color: rgba(255,255,255,0.05);
}
.auth-links .login-link {
  color: #85b58a;
}
.auth-links .logout-link {
  color: #f4d35e;
}

/* Main content wrapper for blog */
.main-content {
  max-width: 75%;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

/* Blog post styling */
form {
  background: #2a2a25;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
input, textarea {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: 6px;
  background: #333;
  color: #f0f0f0;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
}
input::placeholder, textarea::placeholder {
  color: #aaa;
}
button {
  background-color: #85b58a;
  color: #1c1c1a;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
  font-size: 1em;
}
button:hover {
  background-color: #9edb9e;
}

.post {
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}
.post:nth-child(odd) { background-color: #2a2a25; }
.post:nth-child(even) { background-color: #33322d; }
.highlight {
  border-left: 5px solid #f4d35e;
  box-shadow: inset 0 0 10px rgba(255, 255, 0, 0.1);
}
.post h3 {
  margin-top: 0;
  color: #f0f0f0;
  font-size: 1.4rem;
}
.post p {
  color: #ccc;
  line-height: 1.6;
  margin: 0.5rem 0 1rem;
}
.post small {
  color: #888;
  font-size: 0.85rem;
}

/* Media in posts */
.post img, .post video {
  max-width: 100%;
  height: auto;
  margin-top: 1rem;
  border-radius: 8px;
  display: block;
  object-fit: contain;
}

/* Login modal styles */
#loginModal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.82);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s;
}
#loginModal.show {
  display: flex !important;
  visibility: visible;
  opacity: 1;
}
#loginModal form {
  background: #2a2a25;
  padding: 2rem;
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  position: relative;
  box-shadow: 0 4px 18px #0006;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
#loginModal h2 {
  color: #fff;
  margin: 0 0 1rem 0;
}
#loginModal input {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: none;
  border-radius: 6px;
  background: #333;
  color: #f0f0f0;
}
#loginModal input::placeholder { color: #aaa; }
#loginModal button[name="login"] {
  background-color: #85b58a;
  color: #1c1c1a;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}
#loginModal button[name="login"]:hover { background-color: #9edb9e; }
#loginModal button[type="button"] {
  position: absolute;
  top: 10px; right: 15px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Gallery and grid styles */
.grid,
.image-grid,
.gallery-grid,
.album-grid,
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--spacing-md);
  padding: var(--spacing-lg) var(--spacing-sm);
  max-width: 1200px;
  margin: 0 auto;
  justify-items: center;
}

.image-tile,
.gallery-tile,
.album-photo,
.video-tile {
  background: #282823;
  border-radius: var(--border-radius-md);
  box-shadow: 0 0 8px rgba(0,0,0,0.3);
  overflow: hidden;
  text-align: center;
  padding-bottom: var(--spacing-xs);
  transition: transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.image-tile:hover,
.gallery-tile:hover,
.album-photo:hover,
.video-tile:hover {
  transform: scale(1.03);
}
.image-tile img,
.gallery-tile img,
.album-photo img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
  display: block;
  margin: 0;
  box-shadow: 0 4px 16px #0003;
}
.video-tile video {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #181815;
  border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
  display: block;
  box-shadow: 0 4px 16px #0003;
}
.caption {
  margin-top: 0.6rem;
  font-size: 0.98rem;
  color: #aaa;
  text-align: center;
  word-break: break-all;
}

/* Footer */
footer {
  text-align: center;
  padding: var(--spacing-lg) var(--spacing-sm);
  font-size: 0.9em;
  color: #888;
  margin-top: var(--spacing-xl);
  border-top: none;
}

/* Responsive: Tablet */
@media (max-width: 900px) {
  header { min-height: 120px; }
  .logo { width: 86px; height: 86px; }
  .title-text h1 { font-size: 1.4em; }
  nav a { font-size: 1em; padding: 0.35rem 0.8rem; }
  .grid, .image-grid, .gallery-grid, .album-grid, .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xs);
  }
  .main-content { max-width: 90%; padding: 0 var(--spacing-xs);}
}

/* Responsive: Mobile */
@media (max-width: 600px) {
  .branding { padding-top: 0.7rem; }
  .logo { width: 65px; height: 65px; }
  .title-text h1 { font-size: 1.1em; }
  nav { gap: 0.5rem; }
  nav a { font-size: 0.97em; padding: 0.3rem 0.5rem; }
  .grid, .image-grid, .gallery-grid, .album-grid, .video-grid {
    grid-template-columns: 1fr;
    padding: var(--spacing-sm);
  }
  .main-content { max-width: 95%; padding: 0 var(--spacing-xs);}
}