/* ==================
   BASE STYLES
   ================== */
:root {
  --main-background-color: #fffef9;
  --main-text: #333333;
  --secondary-text: #6b6b6b;

  /* Width for desktop content */
  --content-width: 720px;

  /* Link color for within article body */
  --article-link: #4a8045;

  /* Left/right padding for centered page elements*/
  --mobile-container-inset: 10px;
  --container-inset: 30px;
}
* {
    margin: 0;
    box-sizing: border-box;
}
body {
  min-height: 100dvh;
  min-width: 100vw;


  display: flex;
  align-self: center;
  align-items: center;
  flex-direction: column;

  /* Base styles */
  background-color: var(--main-background-color);
  color: var(--main-text);
  font-family: "Inter", -apple-system, sans-serif;

  /* Background pattern */
  background-size: 20px 20px; /* Sets the size of the repeating background image (grid cell) */
  background-image: url("../img/bg-e3e2e0.png");
}

a {
    color: var(--main-text);
    text-decoration: none;
}

h1 {
    font-size: 1.75rem;
}

p {
    font-size: 1rem;
}

/* ==================
   NAV BAR
   ================== */
#site-nav {
    width: 100%;
    max-width: var(--content-width);

    display: flex;
    flex-direction: row;
    align-items: center;

    gap: 10px;
    padding-top: 20px;
    padding-bottom: 30px;
    padding-left: var(--container-inset);
    padding-right: var(--container-inset);

    background-color: var(--main-background-color);
    background-image: none;
}

/* ==================
   UTILITY CLASSES
   ================== */

.text-secondary {
    color: var(--secondary-text);
}
.bg-solid {
    background-color: var(--main-background-color);
    background-image: none;
}

/* ==================
   HOMEPAGE STYLES
   ================== */

#homepage-container {
    display: flex;
    flex-direction: column;  /* stack on mobile */
    align-items: center;
    gap: 2rem;
    background-color: var(--main-background-color);
    margin: auto; /* Center content vertically on desktop */
    padding: var(--mobile-container-inset);
}

#photo { 
    width: 150px;
    height: 189px;
    background-image: url('/assets/img/me-mobile.jpg');
    background-size: cover;
    background-position: center;
}

#photo-wrapper {
    position: relative;
    display: inline-block; /* Wraps tightly around the image */
}

/* Top-right corner */
#photo-wrapper::before {
    content: '';
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px; /* Adjust to match your image size */
    height: 30px;
    background-image: url('../img/top-right.png');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1; /* Ensures corner appears above photo */
}

/* Bottom-left corner */
#photo-wrapper::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: -12px;
    width: 30px; /* Adjust to match your image size */
    height: 30px;
    background-image: url('../img/bottom-left.png');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 1; /* Ensures corner appears above photo */
}

.info {
    width: 300px;
    line-height: 1.35;
}

.info p {
    margin-top: 0.8rem;
    line-height: 1.5;
}

#handwritten-name {
    width: 200px;
}

#name {
    font-size: 1.75rem;
}

#menu {
    margin-top: 0.3rem;
    padding-left: 0;
}

#menu li {
    display: inline;
    margin-right: 0.3rem;
}

#menu a {
    text-decoration: underline;
}

#email {
    font-size: 0.8rem;
}

#signature {
    width: 162px;
    height: 60px;
}

/* Desktop override */
@media (min-width: 768px) {
    #homepage-container {
        flex-direction: row;
        padding: var(--container-inset);
    }
    #photo-wrapper {
        order: -1; /* Put the photo on the left */
    }
    #photo-wrapper::before {
        width: 40px;
        height: 40px;
        top: -12px;
        right: -12px;
    }
    #photo-wrapper::after {
        width: 40px;
        height: 40px;
        bottom: -14px;
        left: -14px;
    }
    #photo {
        width: 300px;
        height: 374px;
        background-image: url('/assets/img/me-desktop.jpg');
    }
}

/* ==================
   BLOG LIST STYLES
   ================== */

.container {
    max-width: var(--content-width);
    width: 100%;
    background-color: var(--main-background-color);
    padding: 0px var(--container-inset);
}

#posts {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 0.5rem;
}

.info-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 1.25em;
}

.post-date {
    white-space: nowrap;
}

.thumbnail {
    display: none;
}

/* Desktop override */
@media (min-width: 768px) {
    .thumbnail {
        width: 120px;
        display: block;
    }
    .post-row {
        height: 130px;
        display: grid;
        grid-template-columns: 120px auto;
        gap: 25px;
    }
}

/* ==================
   POST STYLES
   ================== */

.front-matter {
    display: flex;
    flex-direction: column;
}

.front-matter p {
    line-height: 1.3rem;
}

#title {
    margin-bottom: 0.2rem;
    font-size: 2rem;
}

#subtitle {
    margin-top: 1.1rem;
    margin-bottom: 0.6rem;
}

#line {
    width: 80%;
    align-self: center;
}

#line-divider {
    width: 80%;
    align-self: center;
    height: 40px;
    background-image: url("/assets/img/line-mobile.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.article h2 {
    margin-top: 1em;
}
.article h3 {
    margin-top: 0.75em;
}
.article p {
    margin-top: 0.7rem;
    margin-bottom: 1.3rem;
    line-height: 1.5rem;
}

.article img {
    width: 280px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.article a {
    color: var(--article-link);
}

@media (min-width: 768px) {
    .article img {
        width: 400px;
    }
    #line-divider {
        background-image: url("/assets/img/line.png");
    }
}
