@import url(shared.css);
/* Mobile Navigation Styles - mobile.css */

/* Base CSS Variables and Reset */
body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    line-height: 1.6; /* Better readability on mobile */
}

/* Mobile Header Layout */
header#header {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
        "title"
        "image"
        "navigation";
    text-align: center;
    gap: 1rem;
    padding: 1rem;
}

header#header > img {
    grid-area: image;
    background-color: white;
    justify-self: center;
    width: calc(var(--standard-text-size) * 4);
    aspect-ratio: 1.5 / 1;
    padding: 0.2rem;
}

header#header > div#header-title {
    grid-area: title;
    padding-top: 0; /* Remove top padding on mobile */
}

header#header > div#header-title > h1 {
    font-size: 1.6rem; /* Responsive font size */
    margin-bottom: 0.5rem;
}

header#header > div#header-title > p {
    font-size: 1rem; /* Larger for mobile readability */
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
    display: block;
    justify-self: center;
    background: hsl(
        var(--nav-tab-bg-hue),
        var(--nav-tab-bg-saturation),
        var(--nav-tab-bg-level)
    );
    color: black;
    border: none;
    padding: 15px 20px;
    border-radius: var(--nav-tab-border-radius);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    min-width: 200px;
    text-align: left;
}

.mobile-nav-toggle:after {
    content: "▼";
    position: absolute;
    right: 15px;
    transition: transform 0.3s ease;
}

.mobile-nav-toggle:hover {
    background: hsl(
        var(--nav-tab-bg-hue),
        var(--nav-tab-bg-saturation),
        calc(var(--nav-tab-bg-level) + 10%)
    );
}

/* Checkbox hack for pure CSS dropdown */
.nav-checkbox {
    display: none;
}

.nav-checkbox:checked + .mobile-nav-toggle:after {
    transform: rotate(180deg);
}

.nav-checkbox:checked ~ .nav-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Mobile Navigation Styles */
header#header > nav {
    grid-area: navigation;
    position: relative;
}

/* Hide all radio buttons */
header#header > nav input[type="radio"] {
    display: none;
}

/* Mobile navigation list - dropdown style */
.nav-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(32, 32, 32, 0.95);
    border-radius: var(--nav-tab-border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 5px;
    flex-direction: column;
    gap: 0;
    list-style: none;
    margin: 5px 0 0 0;
    padding: 0;
}

/* Mobile tab styling - remove desktop appearance */
.nav-item {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    transform: none;
    box-shadow: none;
    cursor: pointer;
    display: block;
    padding: 15px 20px; /* Large touch targets */
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s ease;
    text-decoration: none;
    font-weight: bold;
}

.nav-item:hover {
    background: hsl(
        var(--nav-tab-bg-hue),
        var(--nav-tab-bg-saturation),
        var(--nav-tab-bg-level)
    );
    transform: none;
}

.nav-item:hover {
    background: hsl(
        var(--nav-tab-bg-hue),
        var(--nav-tab-bg-saturation),
        var(--nav-tab-bg-level)
    );
    color: black;
}

/* Remove desktop-specific styling for mobile */
input[type="radio"]:checked + .nav-item {
    background: none;
    border: none;
    transform: none;
    box-shadow: none;
}

input[type="radio"]:checked + .nav-item:after {
    display: none;
}

/* Last item rounded corners */
.nav-item:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--nav-tab-border-radius) var(--nav-tab-border-radius);
}

/* First item rounded corners */
.nav-item:first-child {
    border-radius: var(--nav-tab-border-radius) var(--nav-tab-border-radius) 0 0;
}

/* Mobile Content Layout */
main#main {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
    gap: 1rem;
}

#article-content {
    flex: 1;
    border: none;
    background: white;
    border-radius: 5px;
    min-height: 400px;
}

#sub-content {
    width: 100%;
    background: white;
    padding: 1.5rem;
    border-radius: 5px;
    order: 2; /* Move below main content on mobile */
    border-top: solid 0.1rem
        hsl(
            var(--nav-tab-bg-hue),
            var(--nav-tab-bg-saturation),
            var(--nav-tab-bg-level)
        );
}

#sub-content h2 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

#sub-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: var(--standard-text-size);
}

#article-content img {
    margin: calc(var(--standard-text-size) / 2);
}

#article-content p {
    margin-bottom: calc(var(--standard-text-size) / 2);
}
