
/* Donny's Hobby Shop - Main Stylesheet */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f4f1e8;
    color: #2f624d;
    font-weight: 500;
}

header {
    padding: 0;
    margin: 0;
    background-color: #f4f1e8;
}

.site-header-image {
    display: block;
    width: 100%;
    height: auto;
}

/* Top Navigation */

nav {
    background-color: #1f352a;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 15px 24px;
    display: block;
}

nav a:hover {
    background-color: #4f725d;
}

/* Plants Dropdown */

.dropdown {
    position: relative;
    display: flex;
    flex-direction: column;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #1f352a;
    min-width: 200px;
    z-index: 1000;
    max-height: 50vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.dropdown.open .dropdown-content {
    display: block;
}

.dropdown-content a {
    padding: 12px 18px;
    white-space: nowrap;
}

/* Main Content */

main h2 {
    color: #2f4f3e;
}

/* Footer */

footer {
    background-color: #1f352a;
    color: white;
    text-align: center;
    padding: 0;
}

.plant-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 20px 0 35px;
}

.plant-grid .plant-card {
    flex: 0 0 264px;
}

.plant-card {
    width: 264px;
    height: 400px;
    box-sizing: border-box;
    background-image: url("../images/optimized/83c298df8f55760f5445ebd34f7c0fa943f9152f4d7292f46459da066368ab12.webp");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    border-radius: 0;
    padding: 18px;
    text-align: center;
    box-shadow: none;
    margin-left: auto;
    margin-right: auto;
}

.plant-card img {
    width: 198px;
    height: 228px;
    object-fit: contain;
    background: transparent;
    border-radius: 0;
    display: block;
    margin: 30px auto 0;
}

.plant-card h4 {
    margin: 12px 0 4px;
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-weight: 600;
    color: #2f4f3e;
}

.plant-placeholder {
    height: 300px;
    background: #f4f1e8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

/* Plant Admin Edit Form */

.plant-form textarea {
    width: 50%;
    min-height: 140px;
    padding: 10px;
    box-sizing: border-box;
    font-size: 16px;
    resize: vertical;
}

.plant-form .form-group label {
    display: block;
    width: 50%;
    margin-bottom: 6px;
    font-weight: bold;
}

.plant-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.plant-detail-photo {
    max-width: 350px;
    width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
}

.plant-card-link {
    display: block;
    text-decoration: none;
    color: #2f4f3e;
}

.plant-card-link:hover {
    text-decoration: none;
    color: #2f4f3e;
}

.plant-card-link:hover h4 {
    color: #2f4f3e;
}

.edit-plant-name {
    color: #2f4f3e;
    font-size: 24px;
    font-weight: 600;
}

/* ==============================
   Homepage
   ============================== */

/* Move homepage slightly closer to header */

.home-main {
    margin-top: -18px;
}

.home-welcome {
    margin-bottom: 35px;
}

.home-welcome h1 {
    font-size: 1.5em;
    margin: 0 0 10px;
    color: #2f4f3e;
}

/* Homepage Card Grid */

.homepage-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-top: 30px;
}

/* Individual Homepage Card */

.homepage-card {
    width: 264px;
    max-width: 264px;
    height: auto;
    min-height: 420px;
    box-sizing: border-box;
    background-image: url("../images/optimized/83c298df8f55760f5445ebd34f7c0fa943f9152f4d7292f46459da066368ab12.webp");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    border-radius: 0;
    padding: 12px;
    text-align: center;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-self: stretch;
}

/* Card Title */

.homepage-card h3 {
    margin: 10px 18px 40px;
    color: #2f4f3e;
    font-size: 24px;
    position: relative;
    top: 20px;
}

/* Card Description */

.homepage-card p {
    margin: 0 25px 18px;
    color: #2b2118;
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
    text-indent: 20px;
    hyphens: none;
    overflow-wrap: normal;
    color: #2f4f3e !important;
}

/* Card Button */

.homepage-card-button {
    display: inline-block;
    margin-top: auto;
    margin-bottom: 65px;
    align-self: center;
    padding: 10px 20px;
    background-color: #2f4f3e;
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 6px;
}

.homepage-card-button:hover {
    opacity: 0.88;
    color: white;
}

@media (max-width: 700px) {
    .homepage-cards {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .homepage-card {
        width: 264px;
        max-width: 264px;
        align-self: center;
    }
}

/* Image Gallery Category Tree */

.image-category-tree {
    margin-top: 25px;
    max-width: 500px;
    min-width: 0;
}

.image-category-tree ul {
    list-style: none;
    margin: 0;
    padding-left: 22px;
}

.image-category-tree > ul {
    padding-left: 0;
}

.image-category-tree li {
    position: relative;
    margin: 8px 0;
    padding-left: 18px;
}

.image-category-tree a {
    color: #2f4f3e;
    text-decoration: none;
    font-weight: 600;
}

.image-category-tree a:hover {
    text-decoration: underline;
}

.image-category-tree > ul > li > a {
    font-size: 18px;
    font-weight: 700;
}

/* Collapsible Image Category Tree */

.image-category-tree .tree-branch {
    display: none;
}

.image-category-tree li.open > .tree-branch {
    display: block;
}

.tree-toggle {
    background: none;
    border: none;
    padding: 0;
    margin-right: 6px;
    color: #2f4f3e;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    width: 18px;
}

.tree-spacer {
    display: inline-block;
    width: 24px;
}

.image-category-tree li.open > .tree-toggle {
    transform: rotate(90deg);
}

/* Image Gallery Thumbnails */

.gallery-image {
    background-image: url("../images/optimized/83c298df8f55760f5445ebd34f7c0fa943f9152f4d7292f46459da066368ab12.webp");
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    width: 290px;
    box-sizing: border-box;
    padding: 35px 28px;
    border: none;
    border-radius: 0;
    text-align: center;
    box-shadow: none;
}

.gallery-image img {
    width: 220px;
    height: auto;
    max-width: 90%;
    display: block;
    margin: 0 auto;
    border-radius: 3px;
}

.gallery-image p {
    margin: 12px 0 3px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 750;
    color: #2b2118;
}

/* Image Gallery Back Buttons */

.image-gallery-back {
    margin: 12px 0;
}

.image-gallery-back a {
    display: inline-block;
    padding: 9px 16px;
    background: #1f4938;
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
}

.image-gallery-back a:hover {
    background: #2f624d;
}

/* Image Gallery Lightbox */

.image-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    box-sizing: border-box;
}

.image-lightbox.open {
    display: flex;
}

.image-lightbox img {
    max-width: 90%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 25px;
    z-index: 10001;
    width: 50px;
    height: 50px;
    padding: 0;
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid white;
    border-radius: 50%;
    color: white;
    font-size: 38px;
    font-weight: bold;
    line-height: 42px;
    text-align: center;
    cursor: pointer;
}

#lightbox-download {
    display: inline-block;
    margin-top: 18px;
    padding: 10px 20px;
    background: white;
    color: #222;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
}

#lightbox-download:hover {
    background: #e8e8e8;
}

/* Images Page - Two Column Layout */

.images-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    align-items: start;
    margin-top: 25px;
}

.images-layout .selected-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, 290px);
    column-gap: 60px;
    row-gap: 35px;
    margin-top: 0;
}

/* Keep Image Category Menu Visible */

.images-layout .image-category-tree {
    position: sticky;
    top: 20px;
    align-self: start;
}

/* Images Page Introduction */

.images-intro {
    color: #2f624d;
    font-size: 17px;
    font-weight: 700;
}

/* Images Page Mobile Layout */

@media (max-width: 700px) {
    .images-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .images-layout .selected-image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Wider Main Area for Images Page */

main.images-main {
    max-width: 1500px;
}

#top {
    scroll-margin-top: 70px;
}

.back-to-top {
    display: inline-block;
    margin-left: 15px;
    padding: 5px 10px;
    background: #355c3a;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: normal;
    border-radius: 5px;
    vertical-align: middle;
}

.back-to-top:hover {
    opacity: 0.85;
}

footer p {
    margin: 0;
    padding: 6px 0;
}

main {
    padding-left: 40px;
    padding-right: 40px;
}

/* Mobile Layout for Public Images Page */

@media (max-width: 768px) {
    .images-layout {
        display: block;
    }

    .images-layout .image-category-tree {
        position: static;
        width: 100%;
        margin-bottom: 30px;
    }

    .images-layout .selected-image-gallery {
        display: grid;
        grid-template-columns: 1fr;
        gap: 25px;
        justify-items: center;
    }

    .images-layout .selected-image-gallery > * {
        max-width: 100%;
        min-width: 0;
    }
}

/* Larger Text on Mobile Images Page */

@media (max-width: 768px) {
    .images-page h2 {
        font-size: 30px;
    }

    .images-intro {
        font-size: 20px;
        line-height: 1.5;
    }

    .image-category-tree a {
        font-size: 20px;
        line-height: 1.6;
    }

    .image-category-tree > ul > li > a {
        font-size: 20px;
    }

    .tree-toggle {
        font-size: 26px;
    }
}

/* Larger Text Throughout Website on Phones */

@media (max-width: 768px) {
    body {
        font-size: 20px;
        line-height: 1.6;
        color: #2f4f3e;
    }

    main p,
    main li,
    main a {
        font-size: 20px;
    }
}

/* Mobile Parchment Card Caption Adjustment */

@media (max-width: 768px) {
    .plant-card h4 {
        position: relative;
        top: -10px;
        color: #2f4f3e !important;
    }

    .gallery-image p {
        position: relative;
        top: -10px;
        color: #2f4f3e !important;
    }
}

/* Sticky Compact Navigation on Mobile */

@media (max-width: 700px) {
    nav {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    nav a {
        padding: 9px 12px;
    }
}

/* Keep Long Image Titles Inside Parchment */

@media (max-width: 700px) {
    .gallery-image-title {
        margin-top: 4px;
        margin-bottom: 0;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }
}

/* Plant Growth History */

.plant-history {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid #dce3dc;
}

.plant-history-gallery {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 18px;
    overflow-x: auto;
    padding: 12px 0 20px;
    scroll-snap-type: x proximity;
}

.plant-history-card {
    flex: 0 0 180px;
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    padding: 10px;
    box-sizing: border-box;
    background: #f8f5ed;
    border: 1px solid #dce3dc;
    border-radius: 8px;
    scroll-snap-align: start;
}

.plant-history-card img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 160px;
    max-height: 160px;
    object-fit: contain;
    border-radius: 6px;
}

.plant-history-date {
    margin: 12px 0 6px;
    color: #2f4f3e;
    font-weight: bold;
}

.plant-history-note {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

/* Back Button */

.back-button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 15px 20px;
    margin-top: 12px;
    background-color: #2f4f3e;
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
}

.back-button:hover {
    background-color: #243d30;
}

/* Category List */

.category-list summary {
    cursor: pointer;
    font-weight: bold;
    color: #2f4f3e;
    padding: 6px 0;
}

.category-list details > ul {
    margin-top: 8px;
}

.category-list summary::marker {
    color: #2f4f3e;
}
/* Homepage Parchment Card Text - Mobile */

@media (max-width: 768px) {
    .homepage-card p {
        font-family: 'Lora', Georgia, serif;
        font-style: italic;
        font-size: 17px;
        font-weight: 500;
        line-height: 1.6;
        color: #2f4f3e !important;
        text-align: center;
        text-indent: 0;
        hyphens: none;
    }
}
