/* Shared Header Styles */
.header {
    background: white;
    border-bottom: none; /* remove divider */
    padding: 1rem 2rem 0 2rem; /* restored original padding */
    position: static; /* header no longer pinned */
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Calendar header logo */
.calendar-header-logo {
    flex-shrink: 0;
}

.calendar-header-logo img {
    width: 200px !important;
    height: auto !important;
    border-radius: 4px;
    display: block;
}

/* Ensure header images can scale even if global image rules exist */
.header .calendar-header-logo img { max-width: none !important; }

/* Add spacing between header and content in non-embed views (only applies when .header exists) */
.header + .container,
.header + .content-wrapper {
    margin-top: 0; /* override container default spacing */
    padding-top: 1rem; /* extra space between header and controls/back rows */
}

/* Calendar title always on the left */
.header h1 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 700;
    margin-right: auto;
}

/* Back link styling */
.header .back-link {
    color: #3498db;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.header .back-link:hover {
    text-decoration: underline;
}

/* Header Hamburger Menu */
.header-menu {
    position: relative;
    margin-left: auto;
}

.header-menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #2c3e50;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    line-height: 1;
}

.header-menu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.header-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #374151;
    border-radius: 0 0 0.75rem 0.75rem;
    min-width: 180px;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-menu-dropdown.show {
    display: flex;
    flex-direction: column;
}

.header-menu-item {
    color: #e5e7eb;
    text-decoration: none;
    padding: 0.75rem 1rem;
    font-weight: 600;
    transition: background-color 0.15s ease, color 0.15s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.header-menu-item:first-child {
    border-top: none;
}

.header-menu-item:hover,
.header-menu-item:focus {
    background-color: #4b5563;
    color: #ffffff;
}

/* Controls moved to `calendar_controls.css` */

/* Ensure toggle and navigation align nicely on small screens (header fallbacks) */
@media (max-width: 1024px) {
    .header .view-toggle { display: none !important; }
    .header .navigation { gap: 0.5rem; }
    .header .current-month { min-width: 140px; }
}
