@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --black: #1c1c1c;
    --gray: #7E7E7E;
    --gray-light: #E4E4E4;
    --red: #b30000;
    --font-size-base: 1rem;
    --font-size-md: clamp(1.25rem, 0.61vw + 1.1rem, 1.58rem);
    --font-size-lg: clamp(1.56rem, 1vw + 1.31rem, 2.11rem);
    --font-size-xl: clamp(2.44rem, 2.38vw + 1.85rem, 3.75rem);
    --border-radius: 10px;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--black);
    font-size: (var(--font-size-base));
    background-color: #faf5ee;
    background-image: url("../img/img-noise-361x370.png");
    margin: 0;
}

a,
a:visited,
a:active {
    color: var(--black);
}

a.btn,
a.btn:visited,
a.btn:active {
    color: #fff;
}

h1 {
    font-size: var(--font-size-xl);
}

h2 {
    font-size: var(--font-size-lg);
}

h3 {
    font-size: var(--font-size-md);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
    font-family: 'Montserrat', sans-serif;
    font-size: (var(--font-size-base));
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 0.7rem 0.75rem;
    margin-bottom: 1rem;
}

.btn {
    background-color: var(--black);
    border: none;
    color: white;
    padding: 16px 32px;
    text-decoration: none;
    margin: 4px 2px;
    cursor: pointer;
}

.btn-delete {
    padding: 10px 16px;
    background-color: var(--red);
}

img {
    width: 100%;
    height: auto;
}

/* Layout */

.container {
    max-width: 982px;
    margin: 0 auto;
    padding: 0 10px;
}

.main {
    padding: 20px;
}

.hero-image {
    max-height: 528px;
    filter: drop-shadow(0px 32px 32px rgba(0, 0, 0, 0.25));
    overflow: hidden;
    border-radius: var(--border-radius);
}

/* Main header */
.header {
    display: grid;
    align-items: center;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
    padding-top: 10px;
    grid-template-areas: 
    "logo button"
    "menu menu";
}

@media only screen and (min-width: 768px) {
    .header {
        grid-template-columns: auto 1fr auto;
        grid-template-areas: "logo menu button";
    }
}

.header__logo {
    grid-area: logo;
    font-weight: 800;
    font-size: 25px;
    text-decoration: none;
}

.header__logo:hover {
    text-decoration: underline;
}

.header__nav {
    grid-area: menu;
    display: flex;
    justify-content: center;
}

.header__button {
    grid-area: button;
    display: flex;
    justify-content: end;
}

.header__button button {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    border: 0;
    padding: 6px 12px;
    background-color: transparent;
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--black);
    transition: all 0.2s linear;
}

.header__button button:hover {
    border: 2px solid var(--black);
    cursor: pointer;
}

/* Header -> nav */
.header__nav ul {
    list-style-type: none;
    display: flex;
    gap: 1rem;
    font-weight: 600;
    padding: 0;
}

.header__nav ul a {
    padding: 10px;
    text-decoration: none;
}

.header__nav ul a:hover {
    text-decoration: underline;
}

.header__nav ul a.active {
    color: var(--gray);
}

/* Homepage - Author */
.author {
    padding: 10px 0;
    text-align: center;
}

.author__heading {
    margin-top: 10px;
    margin-bottom: 5px;
}

.author__body {
    font-size: var(--font-size-md);
    margin: 5px 0 40px 0;
}

/* Home article list */

.article__heading {
    margin-top: 4rem;
    font-weight: 400;
}

.article-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    font-size: clamp(1.13rem, calc(1.08rem + 0.22vw), 1.25rem);
    font-weight: 500;
    display: flex;
    flex-direction: column;
}

.article-list__date {
    font-size: var(--font-size-base);
    color: var(--gray);
    width: 260px;
    display: inline-block;
}

.article-list li a {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    margin: 18px 0;
}

@media only screen and (min-width: 768px) {
    .article-list li a {
        flex-direction: row;
        align-items: center;
    }

    .article-list__date {
        text-align: right;
    }
}

.article-list li {
    font-size: 24px;
    cursor: pointer;
}

.article-list li:not(:last-child) {
    border-bottom: 1px solid var(--gray-light);
}

.article {
    white-space: pre-wrap;
}

.pagination {
    font-size: 1.3rem;
    color: var(--gray);
    text-decoration: none;
    margin-top: 40px;
    display: inline-block;
}

.pagination:hover {
    color: var(--black);
}

/* Footer */
.footer {
    margin: 4rem;
    text-align: center;
}

/* Search */
.searchBar {
    visibility: hidden;
    transform: translateY(-100px);
    background-color: var(--black);
    padding: 12px 0;
    position: absolute;
    left: 0;
    right: 0;
    transition: all 0.2s;
}


.searchBar.open {
    transform: translateY(0);
    
}

.searchBar input {
    margin: 0;
    padding: 5px 15px;
}

#searchClose {
    position: absolute;
    top: 3px;
    right: 0;
    color: var(--gray-light);
    padding: 15px;
}

#searchClose:hover {
    cursor: pointer;
}

/* Dashboard Admin */
.admin-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .admin-posts {
    padding: 0;
    margin: 0;
  }
  
  .admin-post-controls form {
    display: inline-block;
  }
  
  .admin-post-controls .btn  {
    display: inline-block;
    background-color: var(--black);
    color: var(--gray-light);
    border: 0;
    text-decoration: none;
    font-size: .8rem;
    padding: 4px 8px;
    line-height: 2;
  }
  
  .admin-posts li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
  }