/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--theme-background-color);
    color: var(--theme-text-color);
    line-height: 1.6;
    min-width: 420px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation styles */
nav {
    background-color: var(--theme-bar-color);
    padding: 0.8rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px var(--theme-shadow-color);
    display: block;
    min-width: 420px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    position: relative;
}

.logo {
    max-width: 100px;
    height: auto;
    margin-right: 1rem;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--theme-bar-text-color);
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-item {
    margin: 0 1rem;
}

.nav-link {
    color: var(--theme-bar-text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--theme-link-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--theme-bar-text-color);
    margin: 3px 0;
    transition: 0.3s;
}

.hamburger.active span {
    background-color: var(--theme-bar-text-color);
}

/* Main content styles */
.main-content {
    margin-top: 64px; /* Account for navigation */
    padding: 2rem 1rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    flex-grow: 1;
}

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Section styles */
.section-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--theme-heading-color);
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

/* Brew stages */
.brew-stage {
    margin-bottom: 3rem;
}

.brew-stage-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--theme-heading-color);
    position: relative;
    padding-left: 1rem;
}

.brew-stage-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background-color: var(--theme-subtext-color);
}

.brew-blocks-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.brew-block.expanded {
    grid-column: 1 / -1;
    width: 100%;
}

@media screen and (max-width: 1024px) {
    .brew-blocks-container {
        grid-template-columns: 1fr;
    }
}

.brew-block {
    display: flex;
    flex-direction: column;
    background-color: var(--theme-section-color);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 24px var(--theme-shadow-color);
    transition: all 0.3s ease;
    border: 1px solid var(--theme-border-color);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.brew-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px var(--theme-shadow-focus-color);
}

.brew-block.expanded {
    box-shadow: 0 12px 30px var(--theme-shadow-focus-color) !important;
}

.brew-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--theme-border-color);
}

.brew-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 2.5rem;
}

.brew-label img {
    max-width: 120px;
    height: auto;
    filter: drop-shadow(0 4px 12px var(--theme-shadow-color));
    flex-shrink: 0;
    min-width: 60px;
}

.brew-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    flex-wrap: wrap;
}

.brew-stats-inline {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.25rem;
    justify-content: flex-start;
    width: 100%;
    flex-shrink: 0;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    max-width: 100%;
    flex: 1;
}

/* Make sure the entire brew-header container properly aligns content */
.brew-info {
    display: block;
    width: 100%;
    margin-top: 1rem;
}

.brew-content {
    display: block;
    width: 100%;
    margin-top: 1rem;
}

.brew-info > * {
    margin-bottom: 0.5rem;
    width: 100%;
}

.brew-info > *:last-child {
    margin-bottom: 0;
}

.brew-info h4 {
    color: var(--theme-heading-color);
    font-size: 1.4rem;
    margin-top: 0;
}

.brew-type {
    color: var(--theme-subtext-color);
    font-size: 0.9rem;
}

.brew-date {
    color: var(--theme-subtext-color);
    font-size: 0.9rem;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.untappd-link {
    display: inline-block;
}

.untappd-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.brew-info p {
    margin-bottom: 1rem;
}

.brew-stats {
    display: flex;
    justify-content: flex-start;
    gap: 0.25rem;
    margin: 0.25rem 0;
    flex-wrap: wrap;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
    max-width: 100%;
    flex: 1;
}

.brew-stat {
    text-align: center;
    flex: 1;
    max-width: 80px;
}

.brew-stat-value {
    font-weight: 700;
    font-size: 1.2rem;
    display: block;
}

.brew-stat-label {
    font-size: 0.8rem;
    color: var(--theme-subtext-color);
}

.brew-description {
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    line-height: 1.5;
    max-height: 4.5em; /* 3 lines times line-height */
    margin-bottom: 0 !important;
}

.brew-description.expanded {
    line-clamp: unset;
    -webkit-line-clamp: unset;
    overflow: visible;
    max-height: none;
}

.tbd-value {
    color: var(--theme-subtext-color);
}

footer {
    text-align: center;
    padding: 2rem;
    background: var(--theme-bar-color);
    font-size: 1rem;
    color: var(--theme-bar-text-color);
    margin-top: auto;
}

@media screen and (max-width: 768px) {
    .nav-menu {
        background: var(--theme-bar-color);
        position: fixed;
        top: -100%;
        left: 0;
        flex-direction: column;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px var(--theme-shadow-color);
        z-index: 999;
    }

    .nav-menu.active {
        top: 64px;
    }

    .nav-item {
        margin: 1rem 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-logo img {
        max-width: 150px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .brew-label {
        margin-right: 0;
        justify-content: center;
    }

    .brew-label img {
        max-width: 120px;
    }

    .brew-stats {
        justify-content: center;
    }
}