/* ====================================================================================
   TABLE OF CONTENTS:
   1. BASELINE & VIEWPORT SETUP
   2. AUTH / LOGIN VIEW (APPLE HIG CENTERED STAGE)
   3. DASHBOARD VIEW & STICKY HEADER
   4. NAVIGATION & STATUS INDICATORS
   5. NEW POST ACCORDION
   6. CONTROLS & TOOLBAR
   7. CARDS GRID & ENTRY CARDS
   8. FORM CONTROLS, TOGGLES & BUTTONS
   9. ALERTS, UTILITIES & ACCESSIBILITY
   ==================================================================================== */


/* ====================================================================================
   1. BASELINE & VIEWPORT SETUP
   ==================================================================================== */
   html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

h2 {
    margin-top: 0;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: -0.015em;
}

/* Base & Mobile: Compact padding top on handheld screens */
header.home-hero,
header.home-hero.large-padding-top,
.page-home header.home-hero.large-padding-top {
  padding-top: var(--spacer-small, 4vh) !important;
  box-sizing: border-box;
}

/* Desktop Breakpoint: Generous 16vh breathing room */
@media (min-width: 680px) {
  header.home-hero,
  header.home-hero.large-padding-top,
  .page-home header.home-hero.large-padding-top {
    padding-top: var(--spacer-large, 16vh) !important;
  }
}

/* Header Bottom Margin */
header.home-hero.small-margin-bottom {
  margin-bottom: var(--spacer-small, 4vh) !important;
}

/* Site Name Paragraph: Preserves rhythm */
.home-hero .site-name,
.site-name {
  margin: 0;
}

/* ====================================================================================
   2. AUTH / LOGIN VIEW (APPLE HIG CENTERED STAGE - UNIFIED ACROSS ALL SITES)
   ==================================================================================== */
   html, body.auth-view {
    height: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #ffffff !important;
}

body.auth-view {
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

/* Centered Viewport Wrapper */
.auth-stage,
body.auth-view main {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    padding: 24px 20px !important;
    box-sizing: border-box !important;
}

/* Card Container: Harmonized width across all three sites */
.auth-card,
body.auth-view .container {
    width: 100% !important;
    max-width: 480px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    text-transform: uppercase !important;
}

/* Headline */
.auth-card__title,
body.auth-view h2 {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: -0.015em !important;
    text-transform: uppercase !important;
    color: var(--text-primary, #000000) !important;
    text-align: center !important;
    margin: 0 0 24px 0 !important;
    padding: 0 !important;
}

/* Alert Notification */
.auth-card__alert,
body.auth-view .alert {
    width: 100% !important;
    margin-bottom: 16px !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

/* Form Stack */
.auth-card__form,
body.auth-view form {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Input Field: Full Width, 44px Height & 16px Font Size (Prevents iOS Zoom) */
.auth-card__input,
body.auth-view input[type="password"] {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 16px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif !important;
    font-size: 16px !important;
    line-height: 44px !important;
    letter-spacing: 0.02em !important;
    text-align: center !important;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.15)) !important;
    background-color: #ffffff !important;
    color: #000000 !important;
    outline: none !important;
    transition: border-color 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.auth-card__input::placeholder,
body.auth-view input[type="password"]::placeholder {
    color: rgba(0, 0, 0, 0.4) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
}

.auth-card__input:focus,
body.auth-view input[type="password"]:focus {
    border-color: #000000 !important;
    box-shadow: none !important;
}

/* Fix: WebKit & Chrome Yellow Autofill Override */
.auth-card__input:-webkit-autofill,
.auth-card__input:-webkit-autofill:hover,
.auth-card__input:-webkit-autofill:focus,
.auth-card__input:-webkit-autofill:active,
body.auth-view input[type="password"]:-webkit-autofill,
body.auth-view input[type="password"]:-webkit-autofill:hover,
body.auth-view input[type="password"]:-webkit-autofill:focus,
body.auth-view input[type="password"]:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #000000 !important;
    caret-color: #000000 !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

/* Button: Full Width, 44px Height & 13px Font Size */
.auth-card__button,
body.auth-view .btn,
body.auth-view button[type="submit"] {
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 16px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    background: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #000000 !important;
    cursor: pointer !important;
    outline: none !important;
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.1s ease !important;
}

.auth-card__button:hover,
body.auth-view .btn:hover,
body.auth-view button[type="submit"]:hover {
    opacity: 0.85 !important;
}

.auth-card__button:active,
body.auth-view .btn:active,
body.auth-view button[type="submit"]:active {
    opacity: 0.65 !important;
    transform: scale(0.99) !important;
}


/* ====================================================================================
   3. DASHBOARD VIEW & STICKY HEADER
   ==================================================================================== */
body.dashboard-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 20px 60px 20px !important;
    margin: 0 !important;
    box-sizing: border-box;
    text-transform: uppercase;
    width: 100%;
}

body.dashboard-view .container {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box;
}

.sticky-header-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 999;
    background: #ffffff;
    width: 100%;
    max-width: 100%;
    padding-top: 35px;
    padding-bottom: 20px;
    margin-bottom: 0 !important;
    border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.1));
    box-sizing: border-box;
}


/* ====================================================================================
   4. NAVIGATION & STATUS INDICATORS
   ==================================================================================== */
.quick-nav-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 10px auto;
    box-sizing: border-box;
}

.quick-nav-select {
    width: 100%;
    height: 40px !important;
    background: #ffffff;
    color: #000000;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1)) !important;
    font-family: inherit;
    font-size: var(--font-size-regular, 1rem) !important;
    letter-spacing: -0.015em;
    text-align: center;
    cursor: pointer;
    box-sizing: border-box;
    padding: 0 16px !important;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.quick-nav-select:hover {
    border-color: rgba(0, 0, 0, 0.4) !important;
    background: rgba(0, 0, 0, 0.02);
}

.quick-nav-select:focus {
    outline: none !important;
    border-color: rgba(0, 0, 0, 0.8) !important;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    padding: 0 4px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #aaaaaa;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #d1d1d1;
    display: inline-block;
}

.status-indicator.is-online {
    color: #000000;
}

.status-indicator.is-online .status-dot {
    background-color: #2ecc71;
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.6);
}

.nav-links {
    display: inline-block;
    font-size: var(--font-size-regular, 1rem);
    color: inherit;
    opacity: 0.5;
    text-decoration: none;
    margin: 0 15px;
}

.nav-links:hover {
    opacity: 1;
    text-decoration: none;
}

.bottom-nav {
    text-align: center;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.bottom-nav a {
    opacity: 0.5;
    font-size: 12px;
    text-decoration: none;
    color: inherit;
    letter-spacing: 0.05em;
    transition: opacity 0.3s;
}

.bottom-nav a:hover {
    opacity: 1;
}


/* ====================================================================================
   5. NEW POST ACCORDION
   ==================================================================================== */
.new-post-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 35px auto;
    border: none;
    background: transparent;
    box-sizing: border-box;
}

.new-post-header {
    width: 100%;
    height: 40px;
    background: #000000;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 16px;
    box-sizing: border-box;
    cursor: pointer;
    font-size: var(--font-size-regular, 1rem);
    letter-spacing: -0.015em;
    user-select: none;
    text-align: center;
}

.new-post-header.header-light {
    background: #ffffff !important;
    color: #000000 !important;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.15)) !important;
    transition: border-color 0.2s ease;
}

.new-post-header.header-light:hover {
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.new-post-header.header-light .new-post-toggle-icon span {
    background: #000000 !important;
}

.new-post-toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
}

.new-post-toggle-icon span {
    display: block;
    width: 100%;
    height: 1px;
    background: #ffffff;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.new-post-header.is-open .new-post-toggle-icon span:first-child {
    transform: translateY(4.5px) rotate(45deg);
}

.new-post-header.is-open .new-post-toggle-icon span:last-child {
    transform: translateY(-4.5px) rotate(-45deg);
}

.new-post-body {
    padding: 12px 0 0 0;
    display: none;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
}

.new-post-body.open {
    display: flex;
}


/* ====================================================================================
   6. CONTROLS & TOOLBAR
   ==================================================================================== */
.controls-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 25px;
    width: 100%;
}

@media (min-width: 680px) {
    .controls-bar { 
        grid-template-columns: auto 2fr 1.5fr 1fr; 
    }
}

.controls-bar input,
.controls-bar select,
.controls-bar .btn-refresh {
    height: 40px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    box-sizing: border-box;
    border-radius: 0 !important;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
    background: #ffffff;
    font-family: inherit;
    font-size: var(--font-size-regular, 1rem);
    letter-spacing: -0.015em;
    color: var(--text-primary, #000000);
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
}

.controls-bar select {
    text-align-last: center;
    cursor: pointer;
}

.controls-bar input::placeholder {
    color: var(--text-secondary, #757575);
    opacity: 0.7;
}

.btn-refresh { 
    cursor: pointer; 
    white-space: nowrap; 
    background: #000000 !important; 
    color: #ffffff !important; 
    border: 1px solid #000000 !important;
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px; 
    text-decoration: none; 
    transition: opacity 0.2s ease;
}

.btn-refresh:hover { 
    opacity: 0.85;
    border-color: #000000 !important; 
}


/* ====================================================================================
   7. CARDS GRID & ENTRY CARDS
   ==================================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px; 
    width: 100%;
}

@media (min-width: 680px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; } 
}

@media (min-width: 1200px) {
    .cards-grid { grid-template-columns: repeat(3, 1fr); gap: 30px; } 
}

.entry-card {
    scroll-margin-top: 360px !important;
}

.entry-card img {
    width: 100%; 
    height: 260px;
    display: block;
    object-fit: contain;
    background: #fafafa;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    margin-bottom: 12px; 
    box-sizing: border-box;
}

.entry-card .card-title {
    font-size: var(--font-size-regular, 1rem);
    font-weight: 500;
    color: var(--text-primary, #000000);
    text-align: center;
    letter-spacing: -0.015em;
    margin-bottom: 2px;
}

.entry-card .card-year-display {
    font-size: var(--font-size-small, 0.85rem);
    color: var(--text-secondary, #757575);
    text-align: center;
    margin-bottom: 8px;
}

.entry-card img.crop-insta-preview {
    aspect-ratio: 4 / 5 !important;
    object-fit: contain !important;
}

.entry-card img.pad-90 { padding: 5% !important; }
.entry-card img.pad-85 { padding: 7.5% !important; }

.burger-btn {
    width: 100% !important;
    height: 40px !important;
    min-height: 40px !important;
    background: #ffffff !important;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.12)) !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    font-size: var(--font-size-regular, 1rem);
    letter-spacing: -0.015em;
    color: #000000;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    box-sizing: border-box;
    border-radius: 0 !important;
    appearance: none;
    -webkit-appearance: none;
    margin-bottom: 0 !important;
}

.burger-btn:hover {
    border-color: rgba(0, 0, 0, 0.8) !important;
    background: rgba(0, 0, 0, 0.03) !important;
}

.burger-btn.active {
    background: #000000 !important;
    color: #ffffff !important;
    border-color: #000000 !important;
}

/* Minimalist 2-stroke icon container */
.burger-btn__icon {
    width: 15px;
    height: 7px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
    flex-shrink: 0;
}

/* Exactly 2 lines */
.burger-btn__icon span {
    display: block;
    width: 100%;
    height: 1.5px;
    background-color: currentColor;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}

/* Morph 2 horizontal bars into a centered cross (X) on active */
.burger-btn.active .burger-btn__icon span:first-child {
    transform: translateY(2.75px) rotate(45deg);
}

.burger-btn.active .burger-btn__icon span:last-child {
    transform: translateY(-2.75px) rotate(-45deg);
}

.card-collapsible-fields {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.preview-mode-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
}

.preview-mode-btn {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
    font-size: 10px;
    letter-spacing: 0.05em;
    padding: 4px 0;
    cursor: pointer;
    font-family: inherit;
    color: #888888;
    text-align: center;
    transition: all 0.18s ease;
}

.preview-mode-btn:hover {
    color: #000000;
    border-color: rgba(0, 0, 0, 0.3);
}

.preview-mode-btn.active {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}


/* ====================================================================================
   8. FORM CONTROLS, TOGGLES & BUTTONS
   ==================================================================================== */
form { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    margin: 0; 
}

input[type="text"], 
input[type="password"], 
textarea, 
.btn, 
.file-upload-wrapper, 
.toggle-wrapper {
    margin: 0 !important;
    width: 100%; 
    box-sizing: border-box;
    border-radius: 0 !important; 
    -webkit-appearance: none; 
    appearance: none;
    font-family: inherit; 
    font-size: var(--font-size-regular, 1rem) !important; 
    line-height: 1.2; 
    font-weight: 400; 
    letter-spacing: -0.015em;
    text-align: center;
    border: 1px solid var(--border, rgba(0, 0, 0, 0.1));
    background: #ffffff;
    color: var(--text-primary, #000000);
}

input[type="text"], 
input[type="password"], 
.btn, 
.file-upload-wrapper, 
.toggle-wrapper, 
.card-gemini-prompt, 
.btn-card-gemini {
    height: 40px !important;
    padding: 0 15px;
}

textarea, 
.card-raw-inspiration {
    height: 80px;
    padding: 10px 15px;
    resize: vertical;
    color: inherit;
}

input[type="text"]:focus, 
input[type="password"]:focus, 
textarea:focus { 
    outline: none !important; 
    box-shadow: none !important; 
    border-color: rgba(0, 0, 0, 0.8) !important; 
}

.file-upload-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #757575;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.file-upload-wrapper:hover {
    border-color: rgba(0, 0, 0, 0.4);
    color: #000000;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #757575;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.toggle-wrapper:hover {
    border-color: rgba(0, 0, 0, 0.4);
    color: #000000;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
}

.toggle-switch input { 
    opacity: 0; 
    width: 0; 
    height: 0; 
}

.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 18px;
}

.slider-round:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider-round { 
    background-color: #000000; 
}

.toggle-switch input:checked + .slider-round:before { 
    transform: translateX(16px); 
}

.toggle-row-group { 
    display: flex; 
    gap: 8px; 
    width: 100%; 
}

.toggle-row-group .toggle-wrapper {
    flex: 1;
    font-size: var(--font-size-regular, 1rem) !important;
    padding: 0 15px;
}

.toggle-wrapper span { 
    font-size: var(--font-size-regular, 1rem) !important; 
}

.toggle-switch input:checked + .slider-round.danger { 
    background-color: #ff3b30 !important; 
}

.btn {
    color: rgba(0, 0, 0, 0.45);
    cursor: pointer;
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.btn:hover { 
    color: rgba(0, 0, 0, 0.8); 
    border-color: rgba(0, 0, 0, 0.4); 
}

.btn-card-gemini {
    background: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #000000 !important;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-card-gemini:hover { 
    opacity: 0.85; 
}


/* ====================================================================================
   9. ALERTS, UTILITIES & ACCESSIBILITY
   ==================================================================================== */
.alert { 
    padding: 15px; 
    margin-bottom: 20px; 
    border-left: 3px solid; 
    background: rgba(0, 0, 0, 0.02); 
    text-transform: none; 
    text-align: center; 
}

.success { 
    color: #155724; 
    border-color: #155724; 
}

.error { 
    color: #721c24; 
    border-color: #721c24; 
}

.empty-state { 
    text-align: center; 
    padding: 40px; 
    color: #666; 
    border: 1px dashed #ccc; 
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}