body {
    font-family: 'Inter', sans-serif;
    color: #333;
    background-color: #f8f9fa;
    line-height: 1.6;
}

* {
    box-sizing: border-box;
}

:root {
    --primary-color: #007bff; /* Bootstrap blue */
    --secondary-color: #6c757d; /* Bootstrap gray */
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --warning-color: #ffc107;
    --secondary-dark-color: #343a40;
}

/* Global Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--dark-color);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
    font-size: clamp(1.8rem, 4.5vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
}

main {
    overflow-x: hidden;
}

/* Responsive Typography for Headings */
@media (max-width: 767.98px) {
    h1 {
        font-size: 1.8rem; /* ~28.8px */
    }
    h2 {
        font-size: 1.5rem; /* ~24px */
    }
    h3 {
        font-size: 1.25rem; /* ~20px */
    }
    .navbar-brand span {
        font-size: 1.25rem; /* ~20px */
    }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
    h1 {
        font-size: 2.2rem; /* ~35.2px */
    }
    h2 {
        font-size: 2rem; /* ~32px */
    }
    h3 {
        font-size: 1.8rem; /* ~28.8px */
    }
    .navbar-brand span {
        font-size: 1.5rem; /* ~24px */
    }
}

/* Navbar */
.navbar {
    background-color: var(--dark-color) !important;
    transition: background-color 0.3s ease;
    z-index: 1050;
}

.navbar-brand span {
    color: var(--light-color) !important;
    font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--warning-color) !important;
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.offcanvas {
    background-color: var(--dark-color);
    color: var(--light-color);
}

.offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.offcanvas-title {
    color: var(--light-color);
}

.offcanvas-body .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.75rem 1rem;
}

.offcanvas-body .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--warning-color) !important;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: translateY(-2px);
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--light-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    text-decoration: none;
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--warning-color);
    border-color: var(--warning-color);
    transform: translateY(-2px);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: var(--dark-color);
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    text-decoration: none;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #e0a800;
    transform: translateY(-2px);
}

.btn-outline-warning {
    border-color: var(--warning-color);
    color: var(--warning-color);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.2s ease;
    text-decoration: none;
}

.btn-outline-warning:hover {
    background-color: var(--warning-color);
    color: var(--dark-color);
    transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    background-image: url('static/graphics/With-Text-Programming-Html-Background.jpg');
    background-size: cover;
    background-position: center;
    padding-top: 100px; /* Offset for fixed navbar */
    padding-bottom: 50px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

.hero-section h1 {
    color: var(--light-color);
    margin-top: 3rem; /* Adjust for arrow if needed, otherwise just space from top */
}

.hero-section p.lead {
    color: rgba(255, 255, 255, 0.8);
}

/* General Section Styling */
section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

section:nth-of-type(even) {
    background-color: var(--light-color);
}

section:nth-of-type(odd) {
    background-color: #fff;
}

/* Card Styling */
.card {
    border-radius: 0.75rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

.card-body i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.card-title {
    color: var(--dark-color);
}

/* Specific Block Styles */
#homebrew.bg-primary {
    background-color: var(--primary-color) !important;
}

#homebrew.bg-primary h2, #homebrew.bg-primary h3 {
    color: var(--light-color);
}

#homebrew .list-unstyled li {
    display: flex;
    align-items: flex-start;
}

#homebrew .list-unstyled i {
    font-size: 1.5rem;
    margin-top: 0.2rem;
}

/* Homebrew Course Card */
#homebrew-course .card {
    background-color: var(--secondary-dark-color);
}

#homebrew-course .card-body i {
    color: var(--warning-color);
}

.bg-secondary-dark {
    background-color: var(--secondary-dark-color);
}

/* Accordion */
.accordion-item {
    border: 1px solid rgba(0, 0, 0, 0.125);
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.accordion-button {
    background-color: #fff;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.1rem;
    padding: 1rem 1.25rem;
    text-align: left;
    transition: background-color 0.3s ease;
}

.accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background-color: #e9ecef;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.125);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.accordion-body {
    padding: 1.25rem;
    background-color: #f8f9fa;
    color: #495057;
}

.accordion-body code {
    background-color: #e9ecef;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.875em;
    color: #c22;
}

/* Testimonials */
#testimonialCarousel .carousel-item {
    padding: 2rem;
}

#testimonialCarousel .blockquote {
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
}

#testimonialCarousel .carousel-control-prev-icon,
#testimonialCarousel .carousel-control-next-icon {
    filter: invert(100%);
}

/* Blog Cards */
.blog-card .card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card .card-title {
    color: var(--light-color);
}

.blog-card .card-text {
    color: rgba(255, 255, 255, 0.7);
}

.blog-card:hover .card-title {
    color: var(--warning-color);
}

/* Modals */
.modal-header.bg-primary {
    background-color: var(--primary-color) !important;
}

.modal-header .btn-close-white {
    filter: invert(1);
}

.modal-body code {
    background-color: #e9ecef;
    padding: 0.2em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.875em;
    color: #c22;
    display: block;
    white-space: pre-wrap;
}

.modal-body pre {
    background-color: #e9ecef;
    padding: 1em;
    border-radius: 0.25rem;
    overflow-x: auto;
    font-size: 0.9em;
    color: #c22;
}

.modal-body h3, .modal-body h4 {
    color: var(--dark-color);
}

.modal-body p, .modal-body li {
    color: #495057;
}

.modal-body ul {
    padding-left: 1.5rem;
}

.modal-body strong {
    font-weight: 600;
}

/* Footer */
footer {
    background-color: var(--secondary-dark-color) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    padding-top: 2rem;
    padding-bottom: 2rem;
    position: relative;
    z-index: 10;
}

footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--warning-color);
}

.email-break {
    word-break: break-all;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 350px;
    border-radius: 0.5rem;
    z-index: 1100; /* Higher than modals */
    display: none; /* Hidden by default, shown by JS */
    background-color: var(--dark-color) !important;
    color: var(--light-color) !important;
    padding: 1.5rem !important;
}

.cookie-banner p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.cookie-banner .btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: var(--dark-color);
}

.cookie-banner .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: var(--light-color);
}

/* Cookie Settings Modal */
#cookieSettingsModal .modal-content {
    z-index: 1101; /* Higher than cookie banner */
}

#cookieSettingsModal .modal-header {
    background-color: var(--primary-color) !important;
    color: var(--light-color);
}

#cookieSettingsModal .modal-title {
    color: var(--light-color);
}

#cookieSettingsModal .form-check-label {
    font-weight: 500;
}

#cookieSettingsModal small {
    font-size: 0.85em;
    color: #999 !important;
}

/* Ensure images in grids maintain aspect ratio and consistent height */
.quick-start-grid img, .for-whom-grid img {
    height: 300px; /* Example fixed height */
    object-fit: cover;
    width: 100%;
}

/* Media queries for responsive adjustments */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--dark-color);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .hero-section {
        text-align: center;
    }

    .hero-section .d-flex.flex-column.flex-md-row {
        justify-content: center !important;
    }

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

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

    .offcanvas-body .navbar-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .offcanvas-body .nav-item {
        width: 100%;
    }

    .offcanvas-body .btn {
        width: 100%;
        margin-top: 1rem !important;
        margin-left: 0 !important;
    }
}

@media (min-width: 768px) {
    .navbar-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .navbar-nav .nav-item {
        flex-shrink: 0;
    }
    .navbar-nav::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .cookie-banner {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    .cookie-banner .d-flex {
        flex-direction: column;
        gap: 10px;
    }
    .cookie-banner .btn {
        width: 100%;
    }
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Specific image heights for consistency */
#quick-start .card img, 
#for-whom .card img {
    height: 150px; /* Smaller for circular avatars */
    width: 150px;
    object-fit: cover;
}

#homebrew-course .card img {
    height: 350px;
    object-fit: cover;
    width: 100%;
}

#about img, #homebrew img, #hero img {
    height: 350px; /* Example height for main block images */
    object-fit: cover;
    width: 100%;
}

@media (max-width: 767.98px) {
    #about img, #homebrew img, #hero img, #homebrew-course .card img {
        height: 250px;
    }
}

/* Ensure buttons handle long text */
.btn {
    white-space: normal;
    word-break: break-word;
    text-align: center;
}

/* Sticky bottom elements and footer offset */
.cookie-banner {
    margin-bottom: 0; /* No offset needed, it's fixed */
}

/* Z-index for modals */
#cookieSettingsModal {
    z-index: 1100;
}

#cookieConsentBanner {
    z-index: 1099;
}

/* General link styling */
a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Override specific link styling for buttons */
.btn a {
    color: inherit;
    text-decoration: none;
}

.btn a:hover {
    text-decoration: none;
}

.navbar-brand a {
    text-decoration: none;
}

.navbar-brand a:hover {
    text-decoration: none;
}

.email-break {
    word-break: break-all;
}
/* Base styles for the consent tunnel grid container */
.consentTunnelGrid {
    padding-top: 2rem; /* Top padding for the grid */
    padding-bottom: 2rem; /* Bottom padding for the grid */
    padding-left: 1.5rem; /* Left padding for the grid */
    padding-right: 1.5rem; /* Right padding for the grid */
    box-sizing: border-box; /* Include padding in element's total width and height */
}

/* Heading styles within the consent tunnel grid */
.consentTunnelGrid h1 {
    font-size: 1.8rem; /* Slightly smaller than default h1 for a more compact look */
    line-height: 1.2; /* Improved readability */
    margin-top: 2rem; /* Space above the heading */
    margin-bottom: 1rem; /* Space below the heading */
    font-weight: bold; /* Standard bold weight */
}

.consentTunnelGrid h2 {
    font-size: 1.5rem; /* Moderate heading size */
    line-height: 1.2;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    font-weight: bold;
}

.consentTunnelGrid h3 {
    font-size: 1.25rem; /* Sub-heading size */
    line-height: 1.3;
    margin-top: 1.5rem;
    margin-bottom: 0.7rem;
    font-weight: bold;
}

.consentTunnelGrid h4 {
    font-size: 1.1rem; /* Smaller heading, good for sub-sections */
    line-height: 1.3;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    font-weight: bold;
}

.consentTunnelGrid h5 {
    font-size: 1rem; /* Smallest heading, often used for minor details or labels */
    line-height: 1.4;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

/* Paragraph styles within the consent tunnel grid */
.consentTunnelGrid p {
    font-size: 1rem; /* Standard paragraph font size */
    line-height: 1.6; /* Excellent for readability */
    margin-top: 0; /* No top margin by default, let headings/elements above provide space */
    margin-bottom: 1rem; /* Space between paragraphs */
}

/* Unordered list styles within the consent tunnel grid */
.consentTunnelGrid ul {
    list-style-type: disc; /* Standard bullet points */
    margin-top: 1rem; /* Space above the list */
    margin-bottom: 1rem; /* Space below the list */
    padding-left: 1.5rem; /* Indentation for bullet points */
}

/* List item styles within the consent tunnel grid */
.consentTunnelGrid li {
    font-size: 1rem; /* Standard list item font size */
    line-height: 1.6; /* Consistent line height with paragraphs */
    margin-bottom: 0.5rem; /* Space between list items */
}

/* Optional: Remove bottom margin from the last paragraph/list item to prevent excessive space */
.consentTunnelGrid p:last-child,
.consentTunnelGrid ul:last-child,
.consentTunnelGrid li:last-child {
    margin-bottom: 0;
}
