/* styles.css - Theme for mnrds.org (keskitetty sisältö) */
/* Theme version: 1.2 */

:root{
  --bg: #1f1f1f;
  --surface: #262626;
  --text: #f5f5f5;
  --muted: #bdbdbd;
  --accent: #0a84ff;
  --radius: 8px;
  --max-width: 1100px;
  --gap: 1rem;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
}

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

html, body{
  height: 100%;
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Keskitys: koko sivun sisältö keskelle sekä vaakaan että pystyyn */
body{
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1rem;
}

/* Center */
.container{
  width: 100%;
  max-width: var(--max-width);
  padding: calc(var(--gap) * 1.5);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Header and Navigator */
header{
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding: calc(var(--gap) * 0.75) 0;
  border-radius: calc(var(--radius) / 2);
}

nav{
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

nav a{
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
}

nav a:hover,
nav a:focus{
  background: rgba(255,255,255,0.03);
  outline: none;
}

/* Main */
main{
  width: 100%;
  padding: calc(var(--gap) * 1.5) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* h1, h2, h3 ... */
h1, h2, h3{
  margin: 0 0 0.5rem 0;
  font-weight: 600;
  color: var(--text);
}

p{
  margin: 0 0 1rem 0;
  color: var(--muted);
}

/* Kortit ja pinnat */
.card{
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.03);
  padding: 1rem;
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
}

/* Links and buttons for the site */
a{
  color: var(--accent);
}

button,
.btn{
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

button:focus,
.btn:focus{
  outline: 2px solid rgba(10,132,255,0.25);
  outline-offset: 2px;
}

footer{
  width: 100%;
  padding: calc(var(--gap) * 1) 0;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.03);
  text-align: center;
}

/* Gallery */
.gallery{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  width: 100%;
}

.item{
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Image styles */
.item img{
  width: 100%;
  height: 160px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  display: block;
}

.item img:hover{
  transform: scale(1.03);
  opacity: 0.95;
}

/* Date */
.item .date{
  position: absolute;
  bottom: 1px;
  right: 1px;
  background: rgba(0,0,0,0.55);
  color: var(--text);
  padding: 2px 2px;
  font-size: 12px;
  border-radius: 4px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Like / vote buttons */
.vote{
  margin-top: 0.5rem;
  text-align: center;
}

.vote button{
  font-size: 20px;
  padding: 4px 10px;
  margin: 0 5px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.vote button:hover{
  opacity: 0.9;
}

/* Lightbox */
.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.lightbox img{
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Navigation buttons */
.nav-buttons{
  margin: 20px 0;
  text-align: center;
}

.nav-buttons a{
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  margin: 0 10px;
  box-shadow: var(--shadow);
}

.nav-buttons .disabled{
  background: #555;
  pointer-events: none;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 700px){
  .container{
    padding: 1rem;
  }
  nav{
    gap: 0.5rem;
  }
}

/* Keskitys -osa */
.center{
  display: flex;
  align-items: center;
  justify-content: center;
}
