/* ============================================================
   CLEVELAND COUNTY HISTORY PROJECT - PUBLIC STYLESHEET
   ============================================================
   
   For public-facing pages only.
   Admin styles are in admin.css
   
   ============================================================ */

/* ============================================================
   COLOR PALETTE REFERENCE
   ============================================================
   
   PRIMARY COLORS:
   - Dark Brown (header, footer, borders): #2a2420
   - Gold (accents, buttons): #c9a961
   - Medium Tan (page background): #d4c9b0
   
   TEXT COLORS:
   - Primary text: #2a2420
   - Section headers: #8b3a3a (dark red)
   - Muted text: #666
   - Light text: #e8dcc8
   
   ============================================================ */

/* —————————————— RESET & GLOBAL —————————————— */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Verdana, Arial, sans-serif;
    font-size: 14px;
    color: #2a2420;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Keep Georgia for headers */
h1, h2, h3, h4, h5, h6 {
    font-family: Georgia, "Times New Roman", Times, serif;
}

main {
    width: 100%;
    margin: 0;
    padding: 0;
}

a {
    color: #8b3a3a;
    text-decoration: none;
}

a:hover {
    color: #c9a961;
}

/* —————————————— HEADER BANNER —————————————— */

.site-header {
    width: 100%;
}

.banner {
    background-color: #1a1612;
    background: linear-gradient(to bottom, #2a2420, #1a1612);
    color: #e8dcc8;
    padding: 8px 30px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
}

.banner-left {
    flex: 0 0 auto;
    position: relative;
    z-index: 10;
    padding-right: 20px;
}

.banner-left h1 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 1px;
    font-weight: bold;
    color: #e8dcc8;
    line-height: 1.1;
}

.banner-left .tagline {
    margin-top: 2px;
    font-size: 11px;
    font-style: italic;
    color: #c9a961;
}

.banner-center {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-start;
    position: relative;
    z-index: 5;
}

.photo-placeholder {
    width: 70px;
    height: 70px;
    background-color: #3a332e;
    border: 2px solid #c9a961;
    display: inline-block;
}

.header-photos {
    height: 80px;
    width: auto;
    border: none;
    opacity: 0.9;
}

.banner-right {
    flex: 0 0 35%;
}

/* —————————————— NAVIGATION BAR —————————————— */

.main-nav {
    background-color: #1a1612;
    border-top: 3px solid #c9a961;
    border-bottom: 3px solid #c9a961;
    box-shadow: inset 0 3px 0 0 #8b7355, inset 0 -3px 0 0 #8b7355;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    padding-left: 30px;
}

.nav-left a {
    display: block;
    padding: 10px 18px;
    color: #e8dcc8;
    font-weight: normal;
    text-decoration: none;
    font-size: 14px;
}

.nav-left a:hover {
    background-color: #2a2420;
    color: #c9a961;
}

.nav-right {
    display: flex;
    padding-right: 30px;
}

/* Dropdown Menus */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown .dropbtn {
    display: block;
    padding: 10px 18px;
    color: #e8dcc8;
    font-weight: normal;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    background: none;
    border: none;
}

.dropdown .dropbtn:hover {
    background-color: #2a2420;
    color: #c9a961;
}

.dropdown .dropbtn::after {
    content: " ▼";
    font-size: 9px;
    margin-left: 5px;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #2a2420;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.6);
    z-index: 1000;
    border: 1px solid #c9a961;
    right: 0;
    top: 100%;
}

.dropdown-content a {
    color: #e8dcc8 !important;
    padding: 12px 18px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    border-bottom: 1px solid #3a332e;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #3a332e !important;
    color: #c9a961 !important;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* —————————————— HOME PAGE LAYOUT —————————————— */

.home-layout {
    display: flex;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Left Sidebar - Flush to left edge */
.sidebar {
    width: 130px;
    background-color: #1a1612;
    padding: 20px 12px;
    margin: 0;
}

.sidebar h3 {
    color: #c9a961;
    font-size: 14px;
    margin-bottom: 12px;
    border-bottom: 2px solid #c9a961;
    padding-bottom: 6px;
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar ul li {
    margin-bottom: 3px;
}

.sidebar ul li a {
    color: #e8dcc8;
    font-size: 14px;
    display: block;
    padding: 4px 6px;
}

.sidebar ul li a:hover {
    background-color: #2a2420;
    color: #c9a961;
    text-decoration: none;
}

/* Main Content (Three Columns) */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr;
    gap: 20px;
    padding: 0 15px;
    background-color: transparent;
}

.column {
    background-color: transparent;
    padding: 0;
    border: none;
}

.column h2 {
    color: #8b3a3a;
    font-size: 16px;
    margin-bottom: 10px;
    border-bottom: 2px solid #c9a961;
    padding-bottom: 5px;
}

.column h3 {
    color: #8b3a3a;
    font-size: 14px;
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 8px;
    border-bottom: 1px solid #c9a961;
    padding-bottom: 3px;
}

.column p {
    line-height: 1.5;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #2a2420;
}

.column hr {
    border: none;
    border-top: 1px solid #c9a961;
    margin: 15px 0;
}

.column strong { color: #2a2420; font-size: 11px; }
.column a { color: #2a2420; font-size: 11px; }

.featured-image {
    margin-bottom: 15px;
    text-align: center;
}

.featured-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 35vh;
    object-fit: contain;
    border-radius: 8px;
    border: none;
}

/* Slideshow styles */
.slideshow-container {
    position: relative;
    width: 100%;
    height: 45vh;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;
    margin-top: 10px;
}

.slideshow-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
}

.slideshow-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.slideshow-slide img {
    max-width: 100%;
    max-height: calc(45vh - 30px);
    object-fit: contain;
    border-radius: 4px;
}


.slideshow-container .image-caption {
    font-size: 14px;
    margin-top: 8px;
    font-weight: bold;
    font-family: Verdana, Arial, sans-serif;
    color: #2a2420;
    text-align: center;
}

/* —————————————— CONTENT AREA (for other pages) —————————————— */

.content {
    padding: 30px;
    background-color: transparent;
    margin: 20px;
    border: 3px solid #2a2420;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.content h1 {
    color: #2a2420;
    margin-bottom: 20px;
    font-size: 32px;
}

.content h2 {
    color: #2a2420;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 24px;
}

.content p {
    line-height: 1.7;
    margin-bottom: 15px;
    font-size: 14px;
}

.content ul {
    margin-left: 25px;
    margin-bottom: 20px;
    line-height: 1.9;
}

.content ul li {
    margin-bottom: 8px;
}

/* —————————————— FOOTER —————————————— */

.site-footer {
    clear: both;
    background-color: #1a1612;
    color: #e8dcc8;
    text-align: center;
    padding: 12px 0;
    margin-top: 0;
    border-top: 2px solid #c9a961;
}

.site-footer p {
    margin: 0;
    font-size: 13px;
}

/* —————————————— BROWSE PAGE STYLES —————————————— */

.browse-container {
    padding: 20px;
    max-width: 100%;
}

.browse-container h1 {
    color: #2a2420;
    margin-bottom: 15px;
    font-size: 22px;
}

.search-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f0ebe0;
    padding: 10px 15px;
    border: 2px solid #c9a961;
    margin-bottom: 12px;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-form input[type="text"] {
    padding: 6px;
    border: 2px solid #c9a961;
    width: 250px;
    font-size: 13px;
}

.search-form button {
    padding: 6px 12px;
    background-color: #c9a961;
    color: #1a1612;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
}

.search-form button:hover {
    background-color: #b89851;
}

.clear-search {
    padding: 6px 12px;
    background-color: #8b3a3a;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
}

.sort-options {
    font-size: 13px;
}

.sort-options a {
    color: #8b3a3a;
    text-decoration: none;
}

.sort-options a.active {
    font-weight: bold;
    color: #2a2420;
}

.sort-options a:hover {
    color: #c9a961;
}

.results-count {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.browse-table {
    width: 100%;
    border-collapse: collapse;
    background-color: transparent;
    font-size: 13px;
}

.browse-table th {
    background-color: #2a2420;
    color: #e8dcc8;
    padding: 8px;
    text-align: left;
    font-weight: bold;
    font-size: 13px;
}

.browse-table td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

.thumbnail-cell {
    text-align: center;
}

.thumbnail-wrapper {
    position: relative;
    display: inline-block;
}

.thumbnail {
    max-width: 50px;
    max-height: 50px;
    border: 1px solid #2a2420;
    display: block;
}

.thumbnail-icon {
    max-width: 50px;
    max-height: 50px;
    border: 1px solid #2a2420;
    display: block;
}

.hover-preview {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    z-index: 1000;
    margin-left: 10px;
    background: #fff;
    border: 3px solid #c9a961;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    padding: 5px;
}

.thumbnail-wrapper:hover .hover-preview {
    display: block;
}

.hover-preview img {
    max-width: 350px;
    max-height: 350px;
    display: block;
}

.no-thumb {
    font-size: 11px;
    color: #999;
}

.browse-table td strong a {
    color: #8b3a3a;
    text-decoration: none;
}

.browse-table td strong a:hover {
    color: #c9a961;
}

.edit-link {
    font-size: 11px;
    color: #007bff;
    text-decoration: none;
}

.edit-link:hover {
    text-decoration: underline;
}

.description-cell {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.4;
}

.year-cell {
    font-size: 12px;
    white-space: nowrap;
}

.linked-cell {
    font-size: 12px;
    line-height: 1.5;
}

.linked-cell a {
    color: #8b3a3a;
    text-decoration: none;
}

.linked-cell a:hover {
    color: #8b3a3a;
    text-decoration: underline;
}

.actions-cell {
    font-size: 11px;
    line-height: 1.2;
    color: #666;
}

.action-id {
    margin-bottom: 2px;
    font-weight: bold;
}

.action-buttons {
    margin-bottom: 2px;
}

.action-buttons a {
    color: #007bff;
    text-decoration: none;
}

.action-buttons a:hover {
    text-decoration: underline;
}

.action-date, .action-size, .action-filename {
    margin-bottom: 1px;
}

.action-filename {
    font-family: monospace;
    font-size: 10px;
    color: #2a2420;
    word-break: break-all;
}

.pagination {
    margin-top: 15px;
    text-align: center;
    font-size: 13px;
}

.pagination a, .pagination strong {
    padding: 5px 10px;
    margin: 0 3px;
    text-decoration: none;
    color: #8b3a3a;
    border: 1px solid #c9a961;
}

.pagination a:hover {
    background-color: #c9a961;
    color: #1a1612;
}

.pagination strong {
    background-color: #2a2420;
    color: #e8dcc8;
    font-weight: bold;
}

.no-results {
    padding: 40px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* —————————————— HEADER PAGE LAYOUT STYLES —————————————— */

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    display: flex;
    flex: 1;
    position: relative;
}

.content-wrapper .sidebar {
    width: 200px;
    background-color: #1a1612;
    padding: 20px 15px;
    position: sticky;
    top: 0;
    height: auto;
    overflow-y: auto;
    flex-shrink: 0;
    z-index: 100;
}

.content-wrapper .sidebar h3 {
    color: #c9a961;
    font-size: 14px;
    margin-bottom: 12px;
    border-bottom: 2px solid #c9a961;
    padding-bottom: 6px;
}

.content-wrapper .sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.content-wrapper .sidebar ul li {
    margin-bottom: 3px;
    position: relative;
}

.content-wrapper .sidebar ul li a,
.content-wrapper .sidebar ul li .menu-item {
    color: #e8dcc8;
    font-size: 13px;
    display: block;
    padding: 6px 8px;
    text-decoration: none;
    cursor: pointer;
    position: relative;
}

.content-wrapper .sidebar ul li a:hover,
.content-wrapper .sidebar ul li .menu-item:hover {
    background-color: #2a2420;
    color: #c9a961;
}

.content-wrapper .sidebar .has-submenu {
    position: relative;
}

.content-wrapper .sidebar .has-submenu > .menu-item::after {
    content: " ▸";
    float: right;
    font-size: 11px;
}

.content-wrapper .sidebar .submenu {
    display: none;
    position: fixed;
    background-color: #2a2420;
    width: 170px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.7);
    border: 2px solid #c9a961;
    z-index: 9999;
    padding: 8px 0;
}

.content-wrapper .sidebar .has-submenu:hover .submenu {
    display: block;
}

.content-wrapper .sidebar .submenu li {
    margin-bottom: 0;
}

.content-wrapper .sidebar .submenu li a {
    padding: 7px 12px;
    font-size: 12px;
    color: #e8dcc8;
    border-bottom: 1px solid #3a332e;
    white-space: normal;
    word-wrap: break-word;
}

.content-wrapper .sidebar .submenu li:last-child a {
    border-bottom: none;
}

.content-wrapper .sidebar .submenu li a:hover {
    background-color: #3a332e;
    color: #c9a961;
}

.main-content-area {
    flex: 1;
    min-width: 0;
    position: relative;
    
    /* Parchment background */
    background-image: url('/images/paper_texture.png');
    background-repeat: repeat;
    background-size: auto;
}

/* Edge aging gradient overlay */
.main-content-area::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        transparent 0%, 
        transparent 40%, 
        rgba(139, 115, 85, 0.12) 75%, 
        rgba(90, 70, 50, 0.20) 100%);
    z-index: 0;
    pointer-events: none;
}

/* Ensure content sits above the gradient */
.main-content-area > * {
    position: relative;
    z-index: 1;
}

/* Top nav nested dropdown styles */
.dropdown .dropdown-content .has-flyout {
    position: relative;
}

.dropdown .dropdown-content .has-flyout > a::after {
    content: " ▸";
    font-size: 11px;
    margin-left: 5px;
}

.dropdown .dropdown-content .flyout-menu {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background-color: #2a2420;
    min-width: 160px;
    max-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.6);
    border: 1px solid #c9a961;
    z-index: 1001;
}

.dropdown .dropdown-content .has-flyout:hover .flyout-menu {
    display: block;
}

.dropdown .dropdown-content .flyout-menu a {
    color: #e8dcc8 !important;
    padding: 10px 15px;
    display: block;
    font-size: 13px;
    border-bottom: 1px solid #3a332e;
    white-space: normal;
    word-wrap: break-word;
}

.dropdown .dropdown-content .flyout-menu a:last-child {
    border-bottom: none;
}

.dropdown .dropdown-content .flyout-menu a:hover {
    background-color: #3a332e !important;
    color: #c9a961 !important;
}

/* ============================================================
   VIEW PAGE STYLES
   ============================================================ */

.view-container {
    margin: 15px;
    padding: 15px;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 3px solid #c9a961;
    padding-bottom: 15px;
}

.view-header h1 {
    margin: 0;
    font-size: 28px;
    color: #2a2420;
}

.view-edit-button {
    background-color: #c9a961;
    color: #2a2420;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.view-edit-button:hover {
    background-color: #b89851;
}

.view-media {
    margin-bottom: 25px;
}

.view-image {
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border: 1px solid #ddd;
}

.view-pdf-container {
    position: relative;
    width: 100%;
    min-height: 70vh;
    border: 2px solid #c9a961;
    background-color: #f9f9f9;
}

.view-pdf-embed {
    width: 100%;
    height: 90vh;
    position: relative;
    z-index: 2;
}

.view-pdf-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
}

.view-download-btn {
    display: inline-block;
    margin: 10px;
    padding: 12px 24px;
    background-color: #c9a961;
    color: #2a2420;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.view-download-btn:hover {
    background-color: #b89851;
}

.view-video-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.view-video-player {
    width: 100%;
    max-height: 70vh;
    border: 2px solid #c9a961;
    background-color: #000;
}

.view-audio-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: #faf7f0;
    border: 2px solid #c9a961;
    text-align: center;
}

.view-audio-player {
    width: 100%;
}

.view-txt-container {
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    padding: 20px;
    background-color: #d4c9b0;
    border: 2px solid #c9a961;
}

.view-txt-content {
    font-family: Verdana, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: #2a2420;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    padding: 10px;
    background-color: transparent;
    overflow-x: auto;
}

.view-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #faf7f0;
    border-left: 4px solid #c9a961;
}

.view-metadata {
    margin-bottom: 30px;
    padding: 25px;
    background-color: #d4c9b0;
    border: 1px solid #c9a961;
}

.view-metadata h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #2a2420;
    border-bottom: 2px solid #c9a961;
    padding-bottom: 10px;
}

.view-metadata-row {
    margin-bottom: 12px;
    display: flex;
    gap: 10px;
}

.view-metadata-label {
    font-weight: bold;
    color: #2a2420;
    min-width: 150px;
}

.view-metadata-value {
    color: #4a4440;
}

.view-metadata-value a {
    color: #7d4a3d;
    text-decoration: none;
}

.view-metadata-value a:hover {
    text-decoration: underline;
}

.view-tag {
    display: inline-block;
    background-color: #e8e3d8;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 14px;
    color: #2a2420;
    margin-right: 5px;
}

.view-actions {
    text-align: center;
    margin-top: 20px;
    padding: 15px 0;
}

.view-actions a {
    color: #8b3a3a;
    text-decoration: none;
    margin: 0 15px;
}

.view-actions a:hover {
    color: #c9a961;
}

/* OpenSeadragon Zoom Viewer */
.zoom-viewer-container {
    width: 100%;
    height: 70vh;
    background-color: #2a2420;
    border: 2px solid #c9a961;
    position: relative;
}

.zoom-viewer-container .openseadragon-canvas {
    outline: none;
}

.zoom-instructions {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.text-muted { color: #666; }
.text-italic { font-style: italic; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-25 { margin-bottom: 25px; }

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */

#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #8b3a3a;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: #6b5a45;
}