@keyframes myAnimation { /*https://www.w3schools.com/css/css3_animations.asp*/
  from {color: black;}
  to {color: white;}
}

body {
    margin: 0; /*Ingen vit område bredvid själva sidan*/
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f4f6f5;
    font-size:large;
}

/* GRID LAYOUT */
.hemsida{
  display: grid;
  grid-template-areas:
      "header header"
      "main aside"
      "section section"
      "footer footer";
  grid-template-columns: 5fr 3fr;
  grid-template-rows: 400px auto 1fr 110px;
}

.bloggar{
  display: grid;
  grid-template-areas:
      "header header"
      "main aside"
      "footer footer";
  grid-template-columns: 5fr 3fr;
  grid-template-rows: 400px 1fr 110px;
}

.schackresurser{
  display: grid;
  grid-template-areas:
      "header header"
      "section searchbar"
      "section aside"
      "footer footer";
  grid-template-columns: 5fr 3fr;
  grid-template-rows: 400px 80px 1fr 110px;
}

.blimedlem{
  display: grid;
  grid-template-areas:
      "header header"
      "section aside"
      "footer footer";
  grid-template-columns: 5fr 3fr;
  grid-template-rows: 400px 1fr 110px;
}

.hemsida,
.bloggar,
.schackresurser,
.blimedlem {
    min-height: 150vh; /*https://www.w3schools.com/cssref/pr_dim_min-height.php*/
}

/*css areas*/

nav {
    display: flex;
    justify-content: center;
    gap: 25px;
    padding: 15px;
    background: lightblue;
}

button{
  background: #add8e6;
  color: black;
  font-size: 25px;
  padding: 15px 25px;
  border-radius: 10px;
  cursor: pointer;
}

nav a {
    text-decoration: none;
    color: black;
    font-weight: bold;
    padding: 8px 15px;
    border-radius: 5px;
}

nav a:hover {
  background: white;
  transition: 0.5s;
}

.bloggar main i{
  text-align: right;display: block;font-size:0.9em
}


header{
  grid-area: header;
  background-image: url(/img/schackbild.jpg);
  background-position: 40% 100%;
  background-size: cover;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation-name: myAnimation;
  animation-duration: 4s;
}

header h1, header p {
    margin-left: 20px;
}

aside{
  grid-area: aside;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px;
}

main{
  grid-area: main;
  padding: 20px;
}

main img{
    width: 70%;
    height: auto;
    border-radius: 10px;
}

main p, header p{
    font-size: 18px;
}

section{
  grid-area:section;
  padding: 20px;
}

footer{
  grid-area: footer;
  padding: 20px;
  background-color: lightblue;
}

figure {
	display: flex;
	flex-direction: column;
	align-items: center;
}

/*generic css id*/
#highlight{
    background-color: white;
}

#chesslogo{
  width: 130px;
  border: 2px solid;
  border-color: white;
  transform: rotate(45deg);
  margin-left: 40px;
  margin-top: 40px;
}
/*generic css classes*/

.textcenter{
    text-align: center;
}

.searchbar{
    grid-area: searchbar;
    margin-top: 25px;
    max-width: 90%;
    height: 40px;
    background-color: #f4f6f5;
}

.bread{
  border: 1px solid black;
  padding: 1em; 
  border-radius: 1em
}

.avatar{
  height: auto;
  width: 30%;
  border: 14px groove black; /*https://www.w3schools.com/css/css_border.asp*/
  border-radius: 5px;
  margin:3px
}

.price {
    font-weight: bold; /*Tydlig prislapp*/
    font-size: 18px;
}

.resources { /*Använde grid för att book-cards inte ska hamna bredvid titlen så jag skapade en div för allt som inte är book-cards i schackresurser*/
    display: grid;
    grid-template-areas: 
        "title"
        "book";
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: 25px;
    padding: 20px 30px;
}

.book-flexbox{
    grid-area: book;
    display: flex;
    gap:20px;
    flex-wrap: wrap; 
    justify-content: center;
}

#resourcetitle{
    grid-area: title;
}

#resourcetitle h3{
    font-size: 26px;
    text-decoration-thickness: 5px;
}

#resourcetitle h2{
    text-decoration-thickness: 5px;
    text-decoration:underline;
}

.book-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border: 5px ridge black;
    border-radius: 2px;
}


.book-card {
    background: white;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); /*https://www.w3schools.com/css/css3_shadows_box.asp*/
    transition: 0.3s;
    padding: 10px;
    flex: 0 0 260px; /*https://www.w3schools.com/CSS/css3_flexbox_items.asp*/
    max-height: 480px;
    flex-direction: column; /*https://www.w3schools.com/cssref/css3_pr_flex-direction.php*/
    align-items: center;
}

.book-card:hover {
    transform: translateY(-5px);
}

/*css Kalender*/
.calendar {
    width: 70%;
    height: auto;
    background: white;
    padding: 15px;
    border: 3px solid black;
    border-radius: 10px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-header button {
    background: black;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
}

.days, .dates {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-top: 10px;
}

.days div {
    font-weight: bold;
}

.dates div {
    padding: 10px;
    margin: 2px;
    cursor: pointer;
}

.today {
    background: lightblue;
    border-radius: 50%;
}

.dates div:hover {
    background: #ddd;
}

/* Anmälning */
.anmalan-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 1100px;
    margin: 40px auto;
}

.anmalan-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1); /*https://www.w3schools.com/css/css3_shadows_box.asp*/
    transition: 0.3s;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-card h3 {
    margin-bottom: 10px;
}

.info-card img {
    width: 75%;
    height: auto;
    border: 6px double black;
    border-radius: 8px;
    margin: 10px 0;
    filter: saturate(3) contrast(150%); /*https://www.w3schools.com/cssref/css3_pr_filter.php*/

}

/* Formulär */

#villkor{
    transform: scale(1.4);
}

.anmalan-form-wrap {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.group-label {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    transition: 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: #14532d;
    outline: none;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-check {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.form-link {
    text-decoration: underline;
}

#submitBtn {
    width: 100%;
    padding: 12px;
    background: #14532d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

#submitBtn:hover {
    background: #1f7a45;
}

.form-success {
    display: none;
    margin-top: 15px;
    color: green;
    font-weight: bold;
}

@media (max-width: 500px) {
    .hemsida{
        grid-template-areas:
            "header"
            "main"
            "section"
            "aside"
            "footer";
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .bloggar{
        grid-template-areas:
            "header"
            "main"
            "aside"
            "footer";
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .blimedlem{
        grid-template-areas:
            "header"
            "section"
            "aside"
            "footer";
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .schackresurser{
        grid-template-areas:
            "header"
            "searchbar"
            "section"
            "aside"
            "footer";
            grid-template-columns: 1fr;
            grid-template-rows: auto;
    }

    .hemsida, .bloggar, .schackresurser, .blimedlem{
        gap:10px
    }
    header {
        background-image: url(/img/mobilebg.jpg);
    }
    header h1, header p{
        background-color: black;
        width: calc(100% - 40px);

    }
    .searchbar{
        margin-top: 0px;
        width: 85%;
    }
    nav {
        flex-direction: column;
    }

    #chesslogo {
        max-width: 30%;
    }

    main img {
        width: 95%;
        height: auto;
    }

    section{
        padding-top: 0px;
        padding-bottom: 0px;
    }
    
    .avatar{
        width: 90%;
    }
    
    .calendar{
        width: 90%;
    }

    .info-card img {
        width: 95%;
        height: auto;
    }

    .form-row {
        flex-direction: column;
    }

    .book-card {
        flex: 0 1 calc(50% - 30px); /*För att passa i 2 kolumner och mobilers skärmstorlek är mer varierade.*/
        max-width: calc(50% - 30px);
    }
    .book-card img {
        height: auto;
        width: 30vw;
        max-width: none;
    }

    aside {
        margin-bottom: 10px;
    }
}