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

:root{
  --km-dark:#3f455f;
  --km-main:#4b526f;
  --km-soft:#949bb7;
  --km-bg1:#d8dceb;
  --km-bg2:#c7ccdf;
  --km-white:rgba(255,255,255,.60);
  --km-border:rgba(75,82,111,.14);
  --km-danger:#8a4c55;
}

*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  min-height:100%;
}

body{
  padding:28px 18px;

  font-family:'Jura',sans-serif;
  color:var(--km-dark);

  background:
    linear-gradient(
      rgba(62,65,71,.47),
      rgba(62,65,71,.47)
    ),
    url("https://api.krakkemat.be/media/algemeen/krakkemat-achtergrond.jpg")
    center center / cover fixed no-repeat;

  background-color:#3e4147;
}

button,
input,
textarea,
select{
  font:inherit;
}

/* ==================================================
   PAGINA
================================================== */

.km-gallery-admin{
  width:100%;
  max-width:1000px;

  margin:0 auto;
}

/* ==================================================
   HEADER
================================================== */

.km-gallery-header{
  position:relative;

  margin-bottom:28px;
  padding:28px 28px 30px;

  text-align:center;

  border:1px solid rgba(75,82,111,.10);
  border-radius:22px;

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(255,255,255,.55),
      transparent 48%
    ),
    linear-gradient(
      135deg,
      rgba(216,220,235,.78),
      rgba(199,204,223,.72)
    );

  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.55),
    0 10px 24px rgba(63,69,95,.08);
}

.km-gallery-back{
  position:absolute;

  top:22px;
  left:22px;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-height:42px;

  padding:0 18px;

  border:1px solid rgba(75,82,111,.16);
  border-radius:999px;

  font-size:14px;
  font-weight:700;

  color:var(--km-main);

  text-decoration:none;

  background:rgba(255,255,255,.30);

  transition:
    background .15s ease,
    transform .15s ease;
}

.km-gallery-back:hover{
  background:rgba(255,255,255,.48);
  transform:translateY(-1px);
}

.km-gallery-brand{
  display:inline-flex;
  align-items:center;
  justify-content:center;

  margin:0 0 10px;

  text-decoration:none;
}

.km-gallery-logo{
  display:block;

  width:72px;
  height:72px;

  object-fit:contain;

  opacity:.94;

  transition:
    transform .15s ease,
    opacity .15s ease;
}

.km-gallery-brand:hover .km-gallery-logo{
  transform:translateY(-1px);
  opacity:1;
}

.km-gallery-header h1{
  margin:0;

  font-size:34px;
  line-height:1.1;

  font-weight:700;
  letter-spacing:.05em;

  color:var(--km-dark);
}

.km-gallery-header p{
  margin:10px 0 0;

  font-size:14px;
  line-height:1.5;

  font-weight:500;

  color:var(--km-main);
}

.km-gallery-divider{
  width:130px;
  height:1px;

  margin:20px auto 0;

  background:
    linear-gradient(
      90deg,
      transparent,
      rgba(75,82,111,.30),
      transparent
    );
}

/* ==================================================
   PANELEN
================================================== */

.km-panel{
  margin-bottom:20px;
  padding:22px 18px;

  border:1px solid var(--km-border);
  border-radius:20px;

  background:
    radial-gradient(
      circle at 18% 0%,
      rgba(255,255,255,.55),
      transparent 42%
    ),
    linear-gradient(
      135deg,
      var(--km-bg1),
      var(--km-bg2)
    );

  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.55),
    0 10px 24px rgba(63,69,95,.10);
}

.km-panel-header{
  display:flex;

  align-items:flex-start;
  justify-content:space-between;

  gap:16px;

  margin-bottom:22px;
}

.km-panel-label{
  margin-bottom:5px;

  font-size:12px;
  font-weight:700;

  letter-spacing:.09em;
  text-transform:uppercase;

  color:rgba(75,82,111,.66);
}

.km-panel h2{
  margin:0;

  font-size:22px;
  line-height:1.2;

  font-weight:700;

  color:var(--km-dark);
}

/* ==================================================
   VELDEN
================================================== */

.km-field{
  margin-bottom:18px;
}

.km-field label{
  display:block;

  margin:0 0 7px;

  font-size:14px;
  font-weight:700;

  color:var(--km-main);
}

.km-field input[type="text"],
.km-field input[type="date"],
.km-field input[type="file"],
.km-field textarea,
.km-field select{
  width:100%;

  padding:13px 14px;

  border:1px solid rgba(75,82,111,.16);
  border-radius:13px;

  outline:none;

  font-family:'Jura',sans-serif;
  font-size:16px;
  font-weight:600;

  color:var(--km-dark);

  background:rgba(255,255,255,.58);

  box-shadow:
    inset 0 1px 2px rgba(63,69,95,.08);
}

.km-field textarea{
  min-height:105px;

  resize:vertical;
}


 .km-field select{
  min-height:49px;

  appearance:none;
  -webkit-appearance:none;

  padding-right:48px;

  background-color:rgba(255,255,255,.58);

  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%234b526f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

  background-repeat:no-repeat;
  background-position:right 18px center;
  background-size:12px 7px;
}

.km-field input:focus,
.km-field textarea:focus,
.km-field select:focus{
  border-color:rgba(75,82,111,.35);

  box-shadow:
    0 0 0 2px rgba(75,82,111,.08);
}



.km-field input[type="file"]{
  padding:8px 10px;

  cursor:pointer;
}

.km-field input[type="file"]::file-selector-button{
  margin-right:14px;
  padding:10px 16px;

  border:0;
  border-radius:10px;

  font-family:'Jura',sans-serif;
  font-size:14px;
  font-weight:700;

  color:#fff;

  background:
    linear-gradient(
      135deg,
      var(--km-main),
      var(--km-dark)
    );

  cursor:pointer;
}

.km-field input[type="file"]::-webkit-file-upload-button{
  margin-right:14px;
  padding:10px 16px;

  border:0;
  border-radius:10px;

  font-family:'Jura',sans-serif;
  font-size:14px;
  font-weight:700;

  color:#fff;

  background:
    linear-gradient(
      135deg,
      var(--km-main),
      var(--km-dark)
    );

  cursor:pointer;
}
.km-field-help{
  margin-top:6px;

  font-size:12px;
  line-height:1.4;

  font-weight:500;

  color:rgba(75,82,111,.68);
}

.km-field-row{
  display:grid;

  grid-template-columns:1fr;

  gap:0;
}

/* ==================================================
   FOTO PREVIEW
================================================== */

.km-preview-box{
  overflow:hidden;

  width:100%;

  margin:0 0 20px;

  border-radius:16px;

  background:rgba(255,255,255,.30);

  border:1px solid rgba(75,82,111,.12);
}

.km-preview-box[hidden]{
  display:none;
}

.km-preview-box img{
  display:block;

  width:100%;
  max-height:420px;

  object-fit:contain;

  background:rgba(255,255,255,.35);
}

/* ==================================================
   KNOPPEN
================================================== */

.km-form-actions{
  display:grid;

  grid-template-columns:1fr;

  gap:10px;

  margin-top:4px;
}

.km-button{
  width:100%;
  min-height:50px;

  padding:13px 16px;

  border:0;
  border-radius:14px;

  font-family:'Jura',sans-serif;
  font-size:15px;
  font-weight:700;

  cursor:pointer;

  transition:
    transform .15s ease,
    filter .15s ease,
    opacity .15s ease;
}

.km-button:active{
  transform:translateY(1px);
}

.km-button:disabled{
  cursor:default;

  opacity:.55;
}

.km-button-primary{
  color:#fff;

  background:
    linear-gradient(
      135deg,
      var(--km-main),
      var(--km-dark)
    );

  box-shadow:
    0 8px 16px rgba(63,69,95,.18);
}

.km-button-secondary{
  color:var(--km-main);

  background:rgba(255,255,255,.42);

  border:1px solid rgba(75,82,111,.14);
}

.km-button-danger{
  color:#fff;

  background:
    linear-gradient(
      135deg,
      #9b5962,
      #74414a
    );
}

/* ==================================================
   MELDINGEN
================================================== */

.km-message{
  min-height:20px;

  margin:2px 0 12px;

  font-size:13px;
  line-height:1.4;

  font-weight:700;

  color:var(--km-main);
}

.km-message.km-success{
  color:#45654e;
}

.km-message.km-error{
  color:#874752;
}

/* ==================================================
   BESTAANDE FOTO'S
================================================== */

.km-existing-header{
  align-items:center;
}

.km-gallery-count{
  flex:0 0 auto;

  min-width:42px;

  padding:7px 10px;

  border-radius:999px;

  text-align:center;

  font-size:14px;
  font-weight:700;

  color:#fff;

  background:var(--km-main);
}

.km-gallery-loading,
.km-gallery-empty{
  padding:24px 10px;

  text-align:center;

  font-size:14px;
  font-weight:600;

  color:var(--km-main);
}

.km-gallery-list{
  display:grid;

  grid-template-columns:1fr;

  gap:12px;
}

/* ==================================================
   FOTO BEHEERKAART
================================================== */

.km-gallery-item{
  overflow:hidden;

  border:1px solid rgba(75,82,111,.12);
  border-radius:16px;

  background:rgba(255,255,255,.35);

  box-shadow:
    0 5px 12px rgba(63,69,95,.07);
}

.km-gallery-item-image{
  width:100%;
  aspect-ratio:16 / 10;

  overflow:hidden;

  background:rgba(255,255,255,.35);
}

.km-gallery-item-image img{
  display:block;

  width:100%;
  height:100%;

  object-fit:cover;
}

.km-gallery-item-content{
  padding:15px;
}

.km-gallery-item-title{
  margin:0 0 5px;

  font-size:17px;
  line-height:1.25;

  font-weight:700;

  color:var(--km-dark);
}

.km-gallery-item-date{
  margin:0 0 7px;

  font-size:12px;
  font-weight:700;

  color:rgba(75,82,111,.68);
}

.km-gallery-item-text{
  margin:0;

  font-size:13px;
  line-height:1.45;

  font-weight:500;

  color:var(--km-main);
}

.km-gallery-item-actions{
  display:grid;

  grid-template-columns:1fr 1fr;

  gap:8px;

  padding:0 15px 15px;
}

.km-item-button{
  min-height:44px;

  padding:10px;

  border-radius:12px;

  font-family:'Jura',sans-serif;
  font-size:13px;
  font-weight:700;

  cursor:pointer;
}

.km-edit-button{
  color:var(--km-main);

  background:rgba(255,255,255,.48);

  border:1px solid rgba(75,82,111,.16);
}

.km-delete-button{
  color:#7a4650;

  background:rgba(255,255,255,.35);

  border:1px solid rgba(122,70,80,.20);
}

/* ==================================================
   OVERLAYS
================================================== */

.km-edit-overlay{
  position:fixed;

  inset:0;

  z-index:9999;

  overflow-y:auto;

  padding:
    20px 14px
    calc(20px + env(safe-area-inset-bottom));

  background:rgba(37,41,57,.64);

  backdrop-filter:blur(4px);
}

.km-edit-overlay[hidden]{
  display:none;
}

.km-edit-dialog,
.km-delete-dialog{
  width:100%;
  max-width:600px;

  margin:20px auto;

  padding:20px;

  border-radius:20px;

  background:
    linear-gradient(
      135deg,
      #e1e4ef,
      #ccd1e2
    );

  box-shadow:
    0 22px 60px rgba(20,23,34,.32);
}

.km-edit-dialog-header{
  display:flex;

  align-items:center;
  justify-content:space-between;

  gap:14px;

  margin-bottom:18px;
}

.km-edit-dialog-header h2,
.km-delete-dialog h2{
  margin:0;

  font-size:22px;
  font-weight:700;

  color:var(--km-dark);
}

.km-dialog-close{
  display:flex;

  align-items:center;
  justify-content:center;

  flex:0 0 auto;

  width:42px;
  height:42px;

  padding:0;

  border:0;
  border-radius:50%;

  cursor:pointer;

  font-size:28px;
  line-height:1;

  color:var(--km-main);

  background:rgba(255,255,255,.44);
}

.km-edit-image-wrap{
  overflow:hidden;

  margin-bottom:18px;

  border-radius:15px;

  background:rgba(255,255,255,.35);
}

.km-edit-image-wrap img{
  display:block;

  width:100%;
  max-height:360px;

  object-fit:contain;
}

.km-delete-dialog{
  max-width:460px;

  margin-top:max(80px,15vh);

  text-align:center;
}

.km-delete-dialog p{
  margin:14px 0 22px;

  font-size:14px;
  line-height:1.5;

  font-weight:500;

  color:var(--km-main);
}

/* ==================================================
   PC / TABLET
================================================== */

@media screen and (min-width:650px){

  body{
    padding:34px 24px;
  }

  .km-gallery-header h1{
    font-size:34px;
  }

  .km-panel{
    padding:28px;
  }

  .km-field-row{
    grid-template-columns:1fr 1fr;
    gap:16px;
  }

  .km-form-actions{
    grid-template-columns:
      minmax(190px,1fr)
      minmax(140px,.65fr);
  }

  .km-gallery-list{
    grid-template-columns:
      repeat(2,1fr);
  }

}

/* ==================================================
   GROTERE DESKTOP
================================================== */

@media screen and (min-width:950px){

  .km-gallery-list{
    grid-template-columns:
      repeat(3,1fr);
  }

}

/* ==================================================
   GSM
================================================== */

@media screen and (max-width:649px){

body{
  padding:0;

  background:
    linear-gradient(
      rgba(62,65,71,.47),
      rgba(62,65,71,.47)
    ),
    url("https://api.krakkemat.be/media/algemeen/krakkemat-achtergrond.jpg")
    center center / cover scroll no-repeat;

  background-color:#3e4147;
}

  .km-gallery-admin{
    min-height:100vh;

    padding:
      22px 14px
      calc(28px + env(safe-area-inset-bottom));
  }

  .km-panel{
    border-radius:18px;
  }

  .km-gallery-header{
  padding:
    74px 18px
    26px;
}

.km-gallery-back{
  top:18px;
  left:18px;
}

.km-gallery-brand{
  font-size:20px;
}

.km-gallery-header h1{
  font-size:30px;
}

}