@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;500&family=Playfair+Display:wght@600;700&display=swap');

/* --- Tema-variabler (satt till mörkt som default) --- */
/* Ljust tema */
:root {
  --bg: #f4ecdc;
  --panel: #faf6ed;
  --text: #2f4349;
  --muted: #4c5a5e;
  --accent: #d4af37;
  --card-border: #e7c060;
  --shadow: 0 6px 30px rgba(0,0,0,0.08);
  --button-text: #fff;
}

/* === Grundstil === */
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Lora', serif;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 800px;  /* Minska från 1200px till 800px */
    margin: 0 auto;
    padding: 40px;
    background: var(--panel);
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
}

.logo {
    max-width: 300px;
    height: auto;
    display: block;
    margin: 0 auto 40px;
}

/* Colorable logo using mask image. Create a monochrome mask at images/logo-mask.png
   (white shape on transparent) for best results. The element uses background-color
   to set the logo color (e.g. var(--accent)). */
.logo.logo-color {
  width: 300px;
  height: auto;
  display: block;
  margin: 0 auto 40px;
  background-color: var(--accent);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}

h1 {
    font-family: 'Playfair Display', serif;
    color: var(--accent);
    margin-bottom: 40px;
    font-size: 2.2rem;
    text-align: center;
}

/* === Programlista === */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 40px;
}

tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.event-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  background: transparent;
  border: 2px solid var(--card-border); /* ram runt varje event */
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.20);
}

.thumb {
    width: 280px;
    height: 187px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.thumb:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

.event-text {
  flex: 1;
  text-align: left;
}

.event-text strong {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--text);
}

.date {
    color: var(--muted);
    /* font-style: italic; */
    margin: 4px 0 10px;
}

.desc {
  line-height: 1.7;
  margin-bottom: 25px;
  color: var(--muted);
}

.desc ul,
.desc ol {
  text-align: left;
  padding-left: 1em;
}

.desc a {
  color: var(--accent);            /* tydlig länkfärg (styrs av accent) */
  text-decoration: underline;
  text-decoration-color: rgba(59,130,246,0.25);
}

.desc a:hover,
.desc a:focus {
  color: var(--accent);
  text-decoration-color: rgba(37,99,235,0.35);
  outline: none;
  text-decoration-thickness: 2px;
}

/* länkar */
a {
  text-decoration: none;
  color: inherit;
}

.back-link {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 20px;
}
.back-link:hover {
    color: var(--accent);
}

/* === Detaljsida === */
.event-detail {
  text-align: left;
}

.event-page .event-detail {
  font-size: 150%;
}

.event-detail h1 {
    font-family: 'Playfair Display', serif;
    margin-bottom: 40px;
    font-size: 2.2em;
}

.event-detail .desc {
  font-size: 1.22em;
  line-height: 1.8;
  color: var(--text);
}

.event-detail .desc p,
.event-detail .desc li {
  font-size: 1em;
}

.main-image {
  text-align: center;
  margin: 20px 0 30px;
}

.main-image img {
  width: 100%;
  max-width: 850px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 25px rgba(0,0,0,0.2);
}

.close, .prev, .next {
  color: var(--text);
  font-size: 2.2em;
  position: absolute;
  top: 50%;
  cursor: pointer;
  user-select: none;
}
.close {
  top: 25px;
  right: 35px;
  font-size: 2.5em;
}
.prev {
  left: 8%;
  transform: translateY(-50%);
}
.next {
  right: 8%;
  transform: translateY(-50%);
}

/* === Footer === */
footer {
  margin-top: 60px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
}

/* === Adminpanel – ljus caféstil === */
.admin-container {
  background: var(--panel);
  padding: 30px 40px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 800px;
  margin: 40px auto;
  text-align: left;
}
.admin-container h1, .admin-container h2 {
  font-family: 'Playfair Display', serif;
  color: var(--text);
}
form {
  margin-top: 20px;
  margin-bottom: 40px;
}
form input[type="text"],
form input[type="date"],
form textarea {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  font-size: 1rem;
  font-family: 'Lora', serif;
  box-sizing: border-box;
}
form button {
  background-color: var(--accent);
  color: var(--button-text);
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
}

/* Tabeller i admin */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
}
table th {
  background: rgba(255,255,255,0.02);
  color: var(--text);
  text-align: left;
  padding: 10px;
  border-bottom: 2px solid var(--card-border);
}
table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--muted);
}

/* === Galleri === */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.gallery img {
  width: 220px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery img:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

/* === Lightbox === */
.lightbox {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
}

/* === Theme picker (floating) === */
#theme-picker-root { position: fixed; bottom: 18px; right: 18px; z-index: 1200; }
#theme-picker-btn { background: var(--accent); color: var(--text); border: none; border-radius: 50%; width:44px; height:44px; font-size:20px; cursor:pointer; box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
#theme-picker-menu { display:block; background: var(--panel); color: var(--text); border: 1px solid var(--card-border); border-radius:8px; padding:8px; margin-top:8px; min-width:160px; box-shadow: 0 6px 30px rgba(0,0,0,0.35); }
#theme-picker-menu[aria-hidden="true"] { display:none; }
#theme-picker-menu.open { display:block; }
#theme-picker-menu ul { list-style:none; margin:0; padding:0; }
.theme-item { margin:4px 0; }
.theme-item .theme-select { width:100%; text-align:left; background:transparent; color:var(--text); border:none; padding:8px; border-radius:6px; cursor:pointer; }
.theme-item .theme-select:hover { background: rgba(255,255,255,0.03); }


.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80%;
  box-shadow: 0 0 40px rgba(0,0,0,0.8);
  border-radius: 10px;
}

/* === Admin Login === */
.login-container {
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  max-width: 400px;
  margin: 120px auto;
  padding: 40px 30px;
  text-align: center;
}

.login-container h1 {
  font-family: 'Playfair Display', serif;
  color: var(--text);
  margin-bottom: 10px;
  font-size: 2.2rem;
}

.login-container h2 {
  font-family: 'Lora', serif;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 30px;
  font-size: 1.1rem;
}

.login-container input[type="password"] {
  width: 80%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  font-size: 1rem;
  background: var(--panel);
  color: var(--text);
  margin-bottom: 20px;
}

.login-container button {
  background-color: var(--accent);
  color: var(--button-text);
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
}
.login-container button:hover {
  background-color: var(--accent);  /* Samma som ursprungsfärgen */
}

.login-container .error {
  color: var(--danger);
  background: rgba(179,66,66,0.06);
  border: 1px solid rgba(179,66,66,0.25);
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 15px;
}

/* Ta bort .dark-theme-specifika regler (inte behövs längre) */
/* ...existing code... */

/* Ta bort/ignorera tidigare theme-toggle-styling om den finns */
#theme-toggle { display: none; }

/* Befintliga regler använder nu variabler och blir mörka automatiskt */
/* ...existing code... */

/* Responsiv layout för startsidan och eventlistan */
@media (max-width: 700px) {
  .container {
    max-width: 100vw;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0 5vw 0 5vw;
  }
  .event-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px 4vw 16px 4vw;
    box-sizing: border-box;
  }
  .event-row img.thumb {
    max-width: 100%;
    height: auto;
    margin-bottom: 8px;
    border-radius: 8px;
  }
  .event-text {
    padding: 0;
    font-size: 1em;
  }
  h1, h2 {
    font-size: 1.3em;
    margin-top: 18px;
    margin-bottom: 10px;
    text-align: center;
  }
  .main-image img {
    max-width: 100vw;
    height: auto;
    border-radius: 8px;
  }
  table {
    width: 100%;
    font-size: 1em;
  }
}
