/* GENERAL DEFAULTS */
* { margin: 0px; padding: 0px; }

html { height: 100%; box-sizing: border-box; }
body {
  position: relative;
  margin: 0;
  min-height: 100%;
}

/* HEADINGS DEFAULT */
h1, h2, h3, h4, h5, h6 { color: #000826; font-family: 'Averia Serif Libre', Times, serif; }
ul, ol {
  margin-left: 1.5em;
}

a { text-decoration: none; }
hr { margin: 10px 0px; opacity: .25; }

/* static defaults */
p {
	font-family: 'Noto Serif', serif;
	font-size: 1.2em;
}


/* BUTTON DEFAULT */
.btn {
	color: white;
	background: #000826;
	text-align: center;
	border: none;
	border-radius: 5px;
	display: block;
	letter-spacing: .1em;
	margin: 10px 0px;
	padding: 8px 12px;
	text-decoration: none;
}
.btn:hover {
	cursor: pointer;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* NAVBAR */
.navbar {
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    background-color: #000826;
    padding 0 1rem;
    border-radius: 0px 0px 6px 6px;
    z-index: 999;       /* <-- lift it above everything else */
}
.navbar ul {
    list-style-type: none;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}

.navbar ul li {
    position: relative;
    font-family: 'Noto Serif', serif;
}

.navbar ul li a {
    display: block;
    color: white;
    text-align: center;
    padding: 20px 28px;
    text-decoration: none;
}
.navbar button {
	font-family: 'Noto Serif', serif;
}
.navbar a:hover, .dropdown:hover .dropbtn {
  background-color: white;
  color: #000826;
}

/* LOGO */
.navbar .logo_div {
	float: left; 
	padding-top: 5px;
	padding-left: 40px;
}

.navbar .logo_div h1 {
	color: #ca9118;
	font-size: 3em;
	letter-spacing: 5px;
	font-weight: 100;
	font-family: 'Contrail One', Times, serif;
}

/* DROPDOWN MENU */
.dropdown {
    position: relative;
    display: flex;
    flex-direction: column; /* <-- stack button and menu vertically */
    align-items: stretch;
}

.dropbtn {
    display: block;
    width: 100%; /* Stretch to match parent li */
    padding: 20px 28px;
    box-sizing: border-box;
    color: white;
    text-align: center;
    min-width: 120px;
}


.dropdown-menu {
  display: none;
  opacity: 0;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;             /* keeps it always below the button */
  background-color: #000826;
  min-width: 100%;
  width: 100%;
  z-index: 1000;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  transition: opacity 0.3s ease;
  padding: 0;
  pointer-events:none;
}

.dropdown-menu.open{
  display:block;
  opacity: 1;
  pointer-events:auto;
}



.dropdown-menu li {
  list-style: none;
}

.dropdown-menu li a {
  display: block;
  padding: 12px 16px;
  text-align: left;
  color: white;
  background-color: #000826;
}


.dropdown-menu li a:hover {
    background-color: white;
    color: #000826;
}

.arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    transform: rotate(0deg); /* Default facing right */
}

.rotate {
    transform: rotate(90deg);
}

/* Intro and patreon */
.section {
  padding: 2em;
  margin: 2em auto;
  max-width: 1200px;
  width:90%;
  text-align: left;
}

.section h2 {
  font-size: 1.8em;
  margin-bottom: 0.5em;
}

.section p {
  font-size: 1em;
  line-height: 1.6em;
}

.patreon-button {
  display: inline-block;
  margin-top: 1em;
  font-weight: bold;
  transition: background-color 0.3s ease;
}




/* Form */
.full_page_form {
    display: flex;
    flex-direction: column;
}

/* FOOTER */
.footer {
  position: relative;
  right: 0;
  bottom: 0;
  left: 0;
  color: white;
  background-color: #212121;
  text-align: center;
  width: 100%;
  padding: 20px 0px;
  margin-top: 40px;
}

/* BANNER: Welcome message */
.banner {
	display: flex;
	justify-content: space-between;
	margin: 5px auto;
	min-height: 400px;
	color: white;
	border-radius: 5px;
	background-image: url('/static/images/banner.jpg');
	background-size: cover;
	background-position: 50% 20%;
}
.banner .welcome_msg {
	width: 37%;
	float: left;
	padding: 20px;
	background-color: rgba(255, 255, 255, 0.3);
}
.banner .welcome_msg h1 {
	color: #000826;
	margin: 25px 0px;
	font-size: 2.4em;
	font-family: 'Averia Serif Libre', Times, serif;
}
.banner .welcome_msg p {
	color: white;
	font-size: 1.5em;
	line-height: 1.8em;
    font-family: 'Noto Serif', serif;
}
.banner .welcome_msg p span {
	font-size: .81em; 
	color: #000826;
}
.banner .welcome_msg a {
	width: 30%;
	margin: 20px 0px;
	padding: 12px 15px;
	font-size: 1.2em;
	text-decoration: none;
}
.banner .welcome_msg a:hover {
	background: #000826;
}

/* CONTENT */

.content{
	margin: 0 auto;
	padding: 0 1rem;	
}

.admin_content {
	width:84%;
	min-height: 400px;
	margin:2%;
}

.admin_menu {
	width: 16%;
	display:flex;
	flex-direction:column;
	margin:2%;
}


.admin_menu_button {
	background-color:#000826;
	color: white;
}

/* General Table Styling */
.table-full-width {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px; /* Add some spacing below tables */
}

.table-full-width th, 
.table-full-width td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}

.table-full-width td button {
	width:100%;
}

.table-full-width th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.table-full-width td input,
.table-full-width td select,
.table-full-width td textarea {
    width: 100%;
    box-sizing: border-box;
}

.table-full-width td button {
    padding: 8px 12px;
    border: none;
    background-color: #000826;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.table-full-width td button:hover {
    background-color: #333;
}

/* Full Post */

.full_post_img_div{
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

.full_post_image{
	height: 350px;
}

.comment {
    position: relative;
    padding-left: 15px; /* Space for the line */
    margin-bottom: 20px;
    border-left: 3px solid black;
}

.btn-reply {
    color: black;
    text-align: center;
    border: #000826;
    border-radius: 5px;
    display: block;
    letter-spacing: .1em;
    margin: 10px 0px;
    padding: 8px 12px;
    text-decoration: none;
}

.btn-reply:hover {
	cursor:pointer;
}

.posts {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  box-sizing: border-box;
}
.posts {
    display: flex;
    flex-wrap: wrap;
    gap: 20px; /* Adjust the gap between tiles */
    justify-content: center; /* Center the posts on the page */
}
/* MINI POST tiles */
.posts {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  box-sizing: border-box;
}
.post {
    position: relative; /* Enable positioning for child elements */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 300px;
    min-height: 350px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s;
}

.post:hover {
    transform: translateY(-5px);
}

.post_image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #e4e4e4;
}

.post_info {
    padding: 10px;
}

.post_info h3 {
    font-size: 1.5em;
    color: #000826;
}

.post_info span {
    font-size: 0.9em;
    color: #666;
}

.topic-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: white;
    color: #000826;
    border: 1px solid #000826;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.8em;
    z-index: 1; /* Ensure the button is on top */
    transition: background-color 0.3s;
}

.topic-button:hover {
    background-color: #000826;
    color: white;
}

.content .post .post_info {
	padding: 0px 5px;
	font-weight: 200;
	font-family: 'Noto Serif', serif;
	color: #222;
}
.content .post .post_info span {
	color: #A6A6A6;
	font-style: italic;
}
.content .post .post_info span.read_more {
	position: absolute;
	right: 5px;
	bottom: 5px;
}

/* SINGLE PAGE */
.edit_button {
	float: right;
}
.full-post-div {
	min-height: 300px;
	padding: 20px;
	border: 1px solid #000826;
	border-radius: 2px;
}
.full-post-div h2.post-title {
	margin: 10px auto 20px;
	text-align: center;
}

.post-title-div{
	display:flex;
	justify-content: space-between;
}

.post-body-div {
	font-family: 'Noto Serif', serif;
	font-size: 1.2em;
}
.post-body-div p {
	margin: 20px 0px;
}

/* COMMENTS */
.post-comments {
	font-family: 'Noto Serif', serif;
	font-size: 1.2em;
	overflow: auto;
	margin-top: 25px;
	border-radius: 2px;
	border-top: 1px solid #000826;
	padding: 10px;
}

.comment-textarea {
	width: 100%;
	resize: none;
}
.comment-header {
	display: flex;
	color: #e4e1e1;
}
.comment-spacer {
	margin: 0 10px;
}
.comment-footer {
	display: flex;
	align-items: center;
	margin-bottom: 3%;
	color: #e4e1e1;
}
.comment-btn {
	padding: 5px 5px;
	background-color: white;
	color: #e4e1e1;
}

.comment-btn:hover {
	color: white;
	background: #000826;
}

.post-comment {
	width: 95%;
	float: right;
	border-left: 1px solid #000826;
	padding-left: 2%;
}

.comment-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5em;
}

.comment-actions form,
.comment-actions button {
  margin-left: 0.5em;
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
}


/* NOTIFICATION MESSAGES */
.message {
	width: 100%; 
	margin: 0px auto; 
	padding: 10px 0px; 
	color: #3c763d; 
	background: #dff0d8; 
	border: 1px solid #3c763d;
	border-radius: 5px; 
	text-align: center;
}
.error {
	color: #a94442; 
	background: #f2dede; 
	border: 1px solid #a94442; 
	margin-bottom: 20px;
}
.validation_errors p {
	text-align: left;
	margin-left: 10px;
}


/*———————————————————————————
  Responsive tweaks for ≤768px screens
———————————————————————————*/
@media (max-width: 1024px) {
  html, body {
    overflow-x: hidden;
  }

  /* 1) Make the navbar a true flex container that can wrap its children */
  .navbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 1rem;
  }

  /* 2) Logo goes full-width, centered on its own “row” */
  .navbar .logo_div {
    float: none;
    width: 100%;
    text-align: center;
    padding: 0.5rem 0;
  }

  /* 3) Nav links wrap onto the next line and center themselves */
  .navbar ul {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0.5rem 0;
  }

  /* 4) Shrink the link padding so they fit more comfortably */
  .navbar ul li a,
  .dropbtn {
    padding: 0.5rem 1rem;
    font-size: 0.9em;
  }

  /* 5) Stack the banner vertically */
  .banner {
    flex-direction: column;
    min-height: auto;          /* allow height to grow with content */
  }

  /* 6) Make the welcome box full width and remove its float */
  .banner .welcome_msg {
    width: 100% !important;
    float: none !important;
    padding: 1rem;
    box-sizing: border-box;
    background-color: rgba(255,255,255,0.5);
  }

  /* 7) Tweak text sizes if you like */
  .banner .welcome_msg h1 {
    font-size: 1.8em;
  }
  .banner .welcome_msg p {
    font-size: 1.1em;
    line-height: 1.4em;
  }


  /* Ensure the main content takes full width */
  .wiki-content {
    max-width: 100% !important;
    flex: 1 1 100%;
    padding: 1rem; 
  }

  .sidebar-toggle {
    display: block !important;
  }

  .wiki-sidebar-left,
  .wiki-sidebar-right {
    display: none !important;
  }

  .sidebar.shown {
    display: block !important;
    position: fixed;
    top: 0;
    bottom: 0;
    width: 80vw;
    max-width: 300px;
    background: white;
    overflow-y: auto;
    padding: 1rem;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.3);
  }

  #sidebar-left.shown { left: 0; }
  #sidebar-right.shown { right: 0; }

  #overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
  }
}


/* wiki styling */

/* Default behavior: show sidebars on desktop */
.sidebar {
  display: block;
}

.wiki-wrapper {
  display: flex;
  justify-content: center;
  margin: 2rem auto;
  gap: 1.5rem;
  max-width: 1200px;
  padding: 0 1rem;
}

.wiki-column {
  background: #fff;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar.hidden {
  display: none;
}

@media (min-width: 1025px) {
  .sidebar.hidden {
    display: block; /* Always show on desktop */
  }
}

/* Left Sidebar */
.wiki-sidebar-left {
  width: 200px;
  font-size: 0.9em;
}

.wiki-sidebar-left ul {
  list-style: none;
  padding-left: 0;
}

.wiki-sidebar-left li {
  margin: 4px 0;
}

/* Right Sidebar */
.wiki-sidebar-right {
  width: 200px;
  font-size: 0.9em;
}

.wiki-sidebar-right ul {
  list-style: none;
  padding-left: 0;
}

.wiki-sidebar-right li {
  margin: 4px 0;
  margin-left: 10px;
}

.wiki-sidebar-right li.level-2 { margin-left: 20px; }
.wiki-sidebar-right li.level-3 { margin-left: 30px; }
.wiki-sidebar-right li.level-4 { margin-left: 40px; }
.wiki-sidebar-right li.level-5 { margin-left: 50px; }
.wiki-sidebar-right li.level-6 { margin-left: 60px; }

/* Main Content */
.wiki-content {
  flex: 1;
  max-width: 800px;
}

.wiki-page h1 {
  margin-top: 0;
}

.wiki-controls {
  margin-bottom: 1rem;
  text-align: right;
}

.wiki-search-bar {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 1rem auto;
}

#wiki-search-box {
  width: 100%;
  font-size: 1em;
  /*border: 1px solid #ccc;*/
  border-radius: 4px;
}

/* Popout sidebar controls */
.sidebar-toggle {
  display: none; /* hidden by default on desktop */
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: #000826;
  color: white;
  width: 24px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  cursor: pointer;
  z-index: 999;
  font-size: 1.2em;
  border-radius: 4px;
}
.left-toggle { left: 0; }
.right-toggle { right: 0; }

#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
}


#sidebar-left.shown { left: 0; }
#sidebar-right.shown { right: 0; }


.button {
  background-color: #444;
  color: white;
  padding: 0.4em 1em;
  margin-right: 0.5em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.button:hover {
  background-color: #222;
}

.button.danger {
  background-color: #a33;
}

.button.save {
  background-color: #296;
}

.last-edited {
  font-size: 0.9em;
  color: #666;
}

.markdown-body {
  line-height: 1.6;
}

.markdown-body pre {
  background: #f7f7f7;
  padding: 0.5em;
  overflow-x: auto;
  border-radius: 4px;
}

.markdown-body code {
  background: #f0f0f0;
  padding: 2px 4px;
  border-radius: 3px;
}

.markdown-body p {
    margin-bottom: 1em;
}



/* flash floating toast */
.flash-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #333;
  color: white;
  padding: 1em 1.5em;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  z-index: 1000;
  opacity: 1;
  transition: opacity 1s ease;
  font-size: 0.9em;
  max-width: 300px;
  white-space: pre-wrap;
}

/* recipe list */
.recipe_list ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em 2em; /* vertical, horizontal spacing */
  list-style: disc inside;
  padding: 0;
  margin: 1em 0;
}

.recipe_list ul li {
  width: calc(33.3333% - 2em);
}

@media(max-width:1000px){
  .recipe_list  ul li{
    width: calc(50% - 2em);
  }
  
}

@media(max-width:600px){
  .recipe_list  ul li{
    width: 100%;
  }
}


.ingredient-columns {
  display: flex;
  gap: 2em;
  margin-bottom: 2em;
}

.ingredient-columns .column {
  flex: 1;
}

@media (max-width: 768px) {
  .ingredient-columns {
    flex-direction: column;
  }
}

.wide-input {
  width: 100%;
  max-width: 600px;
  font-size: 1em;
}


.pkg-table { border-collapse: collapse; width: 100%; }
  .pkg-table th, .pkg-table td { padding: 6px 8px; vertical-align: top; }
  .pkg-table thead th { text-align: left; border-bottom: 1px solid #3333; }

  .pkg-table input, .pkg-table textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 6px;
  }

  /* column sizing hints */
  .w-from { min-width: 10rem; }
  .w-dest { min-width: 10rem; }
  .w-tracking { min-width: 12rem; }
  .w-things { min-width: 16rem; }
  .w-small { min-width: 10rem; }
  .w-last { min-width: 18rem; }

  .add-table textarea { resize: vertical; }

.pkg-wrap { max-width: 1920px; }
  .table-scroll { overflow-x: auto; }

  table.pkg-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 1050px; /* keeps columns usable; scrolls on small screens */
    table-layout: fixed;
  }

  .pkg-table th, .pkg-table td {
    padding: 8px 10px;
    vertical-align: top;
    border-bottom: 1px solid rgba(0,0,0,0.12);
    overflow: hidden;
  }   
  
  pkg-table td {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .pkg-table thead th {
    text-align: left;
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.95);
    z-index: 1;
  }

  .pkg-table tbody tr:nth-child(even) { background: rgba(0,0,0,0.03); }

  .pkg-table input, .pkg-table textarea, .pkg-table button { font: inherit; }
  .pkg-table input, .pkg-table textarea { width: 100%; box-sizing: border-box; padding: 6px 8px; }
  .pkg-table textarea { resize: vertical; }

  /* columns */
  .c-from { width: 10rem; }
  .c-things { width: 16rem; }
  .c-trk { width: 15rem; }
  .c-status { width: 7rem; }
  .c-loc { width: 8rem; }
  .c-fore { width: 12rem; }
  .c-last { width: 16rem; }   /* reduce from 28rem */
  .c-dest { width: 10rem; }
  .c-act { width: 12rem; }

  .cell-laststatus { white-space: normal; word-break: break-word; line-height: 1.25; }
  .add-row { background: rgba(0, 120, 255, 0.06); }
  .muted { color: rgba(0,0,0,0.55); font-style: italic; }
