@font-face {
    font-family: "ChaletComprime";
    src: url("../fonts/ChaletComprimeCologneSixty.ttf");
}

:root {
  --bg: linear-gradient(to right, rgba(21, 23, 32, 1) 0%, rgba(21, 23, 32, 0.8) 100%);
  --bg-c: #0000009e;
  --fg: #e8e8ea;
  --muted: #a1a1aa;
  --card: #121318;
  --border: #1e1f27;
  --accent: #4e4e4ec5;
}

* { box-sizing: border-box; }
html, body { min-height: 100vh; background: var(--bg); background-color: var(--bg-c); }
body.theme { margin: 0; background: var(--bg); background-color: var(--bg-c); background-size: auto; background-repeat: calc(); color: var(--fg); font: 22px/1.9 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell; font-family: ChaletComprime; letter-spacing: 3.5px; }

.container { width: min(1200px, 92%); margin-inline: auto; }
.page-title { font-size: clamp(1.5rem, 2.4vw, 2.2rem); margin: 2rem 0 1rem; }
.muted { color: var(--muted); }

/* Header */
.site-header { position: sticky; top: 0; backdrop-filter: blur(6px); background: color-mix(in oklab, var(--bg), transparent 30%); border-bottom: 1px solid var(--border); z-index: 20; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding: .8rem 0; }
.brand { color: var(--fg); text-decoration: none; font-weight: 700; letter-spacing: .2px; }
.nav .nav-link { color: var(--fg); opacity: .85; text-decoration: none; margin-left: 1rem; border: none; background-color: transparent; font-family: ChaletComprime; letter-spacing: 1.5px; font-size: 20px; }
.nav .nav-link:hover { opacity: 1; }

/* Hero */
.hero { position: relative; min-height: 62vh; }
.hero-media { position: absolute; inset: 0; background-size: cover; background-position: center; filter: brightness(.82); }
.hero-cta { position: absolute; left: 45%; bottom: 0.2rem; transform: translateX(-45%); }
.btn-primary { display: inline-block; padding: .9rem 1.3rem; background: var(--accent); color: white; text-decoration: none; border: none; border-radius: 999px; box-shadow: 0 5px 30px rgba(138, 138, 138, 0.35); font-weight: 500; letter-spacing: 2px; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary.returnBtn { padding-top: .6em; padding-bottom: .6rem;}

/* Fade-in */
.fade-in { opacity: 0; animation: fadeIn .9s ease forwards; }
.fade-in-delay { opacity: 0; animation: fadeIn 1s ease .6s forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Grid cards Images Management Page */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin: 1rem 0 3rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .25s ease, box-shadow .25s ease; display: grid; grid-template-rows: 160px auto; }
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.card-media { background-size: contain; background-repeat: no-repeat; background-position: center; }
.card-body { padding: 1rem; }
.card-title { margin: 0 0 .4rem; font-size: 1.1rem; }
.card-text { margin: 0; color: var(--muted); }

.img-list { background-size: auto; background-repeat: no-repeat; background-position: center; }

/* Grid cards Dashboard */
.grid-cards.main { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 1.2rem; margin: 1rem 0 3rem; }

@media (min-width: 700px) { .grid-cards.main { grid-template-columns: repeat(2, 1fr); } } /* ~tablet */
@media (min-width: 1024px) { .grid-cards.main { grid-template-columns: repeat(3, 1fr); } /* at least 3 */ } /* desktop */
@media (min-width: 1400px) { .grid-cards.main { grid-template-columns: repeat(4, 1fr); } } /* optional: add 4th column on large screens */

/* Masonry (simple responsive grid) */
.masonry { columns: 1; column-gap: 1rem; }
.masonry-item { break-inside: avoid; margin-bottom: 1rem; }
.masonry-item img { width: 100%; border-radius: 12px; display: block; }
@media (min-width: 640px) { .masonry { columns: 2; } }
@media (min-width: 1024px) { .masonry { columns: 3; } }

/* Dashboard */
.dsh-link {
  text-decoration: none;
  font-size: 22px;
}
.dsh-link:hover {
  text-decoration: underline;
}
/* make forms sit inline with links */
.dsh-inline { display: inline; margin: 0; padding: 0; }
.dsh-album-view { color: cadetblue; }
.dsh-album-edit { color: lightgreen; }
.dsh-album-del { color: lightcoral; }
.dsh-album-delimg { color: crimson; }
/* make the submit buttons look like links */
.dsh-btn {
  background: none;
  background-color: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}
/* optional: tweak separators */
.dsh-album-list .sep { color: var(--muted); margin: 0 .2rem; }

.img-info { font-size: 18px; letter-spacing: 1.5px;}

/* --- Featured image widget (dashboard) --- */
.fi-widget { display: grid; gap: .5rem; margin-bottom: .6rem; }
.fi-initial { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.fi-label { color: var(--muted); }

.fi-initial-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg), transparent 10%);
  color: var(--fg);
  text-decoration: none;
  font-size: 0.9rem;
  backdrop-filter: blur(6px);
  transition: transform .15s ease, opacity .15s ease, filter .15s ease;
  opacity: .95;
}
.fi-initial-link:hover { transform: translateY(-1px); opacity: 1; filter: brightness(1.05); }

.fi-actions { display: flex; align-items: center; gap: .6rem; }
.fi-input-label { color: var(--muted); }

/* Styled clear checkbox */
.fi-clear { display: inline-flex; align-items: center; gap: .4rem; }
.fi-clear-checkbox {
  appearance: none;
  width: 18px; height: 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: color-mix(in oklab, var(--bg), transparent 10%);
  display: inline-block;
  position: relative;
  cursor: pointer;
}
.fi-clear-checkbox:hover { filter: brightness(1.05); }
.fi-clear-checkbox:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.fi-clear-checkbox:checked {
  background: color-mix(in oklab, #d32f2f, var(--bg) 60%);
  border-color: color-mix(in oklab, #d32f2f, var(--border) 50%);
}
.fi-clear-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 10px; height: 10px;
  transform: translate(-50%, -50%);
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 10"><path fill="white" d="M4.5 7.5L1.5 4.5l-1 1 4 4 8-8-1-1z"/></svg>') no-repeat center/contain;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 10"><path fill="white" d="M4.5 7.5L1.5 4.5l-1 1 4 4 8-8-1-1z"/></svg>') no-repeat center/contain;
  background: #fff;
}
.fi-clear-label { color: var(--muted); user-select: none; cursor: pointer; }

.btn-primary.dashboard { padding-top: 2px; padding-bottom: .2rem; }

/* --- Dashboard image overlay actions --- */
.img-actions {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: .35rem;
  z-index: 5;
}

.icon-fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, black, transparent 30%);
  color: var(--fg);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform .15s ease, opacity .15s ease, filter .15s ease;
  opacity: .9;
}
.icon-fab:hover { transform: translateY(-1px); opacity: 1; filter: brightness(1.05); }
.icon-fab i { pointer-events: none; }
.icon-fab:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Danger variant for delete */
.icon-fab.is-danger {
  background: color-mix(in oklab, #d32f2f, black 70%);
  border-color: color-mix(in oklab, #d32f2f, var(--border) 60%);
}

/* --- Image zoom modal pop-up (dashboard) --- */
.card-media { position: relative; }

.icon-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, black, transparent 50%);
  color: var(--fg);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform .15s ease, opacity .15s ease;
  opacity: .9;
}
.icon-zoom:hover { transform: translateY(-1px); opacity: 1; }
.icon-zoom i { pointer-events: none; }

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}
.modal.open { display: block; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
}
.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  max-width: min(92vw, 1280px);
  max-height: 90vh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  overflow: hidden;
}
.modal-content img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  background: #000;
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--bg), transparent 10%);
  color: var(--fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.modal-close:hover { filter: brightness(1.1); }
.modal-close:focus, .icon-zoom:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-compact { padding: .45rem .8rem; font-size: .9rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 4rem; padding: 1.2rem 0; }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); color: var(--fg); opacity: .8; }
.icon-btn:hover { opacity: 1; }
.text-no-decoration { text-decoration: none; }
.copy { font-size: 18px; letter-spacing: 1.5px; }