:root {
    --main-width: 100vw;
    --ink: #161616;
    --muted: #5a5a5a;
    --paper: #ffffff;
    --teal: #1b9ea1;
    --teal-bright: #2cb8bb;
    --teal-soft: #d4eef0;
    --gold: #b57c0d;
    --gold-bright: #f0b429;
    --gold-soft: #fbe7b0;
    --welcome: linear-gradient(135deg, #7fd8ac 0%, #7fabd8 100%);
    --welcome-rev: linear-gradient(135deg, #7fabd8 0%, #7fd8ac 100%);
    --band-insight: linear-gradient(90deg, #cfecee 0%, #e7f5f4 55%, #f3fafa 100%);
    --band-tool: linear-gradient(90deg, #fbe3a4 0%, #f6d27a 42%, #f8e7c0 100%);
    --link: #0f6e71;
    --highlight: #ffe08a;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
}

.page-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: var(--paper);
}

.title-box {
    padding: 20px;
    color: var(--ink);
    font-size: 36px;
    font-weight: bold;
}

nav {
    display: flex;
    margin-left: auto;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
}

nav a {
    color: var(--ink);
    padding: 10px 15px;
    text-decoration: none;
    font-size: 20px;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 8px;
    margin-right: 10px;
    margin-bottom: 10px;
}

nav a.active {
    background: var(--welcome-rev);
    color: var(--ink);
    font-weight: bold;
}

nav a:not(.active):hover {
    background-color: #e0e0e0;
}

.editor_active {
  background-color: #000;
  color: #fff;
  font-weight: bold;
}

nav a:not(.editor_active):hover {
    background-color: #e0e0e0;
}

a {
    color: var(--link);
    text-decoration: underline;
}

.welcome-container {
    display: grid;
    grid-template-columns: minmax(0, 0.3fr) minmax(0, 0.35fr) minmax(0, 0.35fr);
    align-items: center;
    padding-top: 20px;
    background: var(--welcome);
    width: 100%;
}

.welcome-container a {
    color: #000000;
    padding: 10px 15px;
    text-decoration: none;
    font-size: 20px;
    background-color: #ffffff;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 8px;
}

.welcome-container a:hover {
    background-color: #e0e0e0;
}

.welcome-container p {
    margin-top: 10px;
    font-size: 18px;
    color: #000000;
}

.welcome-column-left {
    display: flex;
    justify-content: flex-end;
    text-align: right;
    padding: 20px 2.5em 20px 20px;
}

.welcome-column-left img {
    border-radius: 8px;
    width: 135px;
    height: auto;
}

.welcome-column-center {
    padding: 20px;
    text-align: left;
    min-width: 0;
}

.welcome-column-right {
    padding: 20px;
    text-align: left;
    color: #000000;
    min-width: 0;
}

.content_container {
    padding: 0;
}

.content_row {
    display: grid;
    grid-template-columns: minmax(0, 0.3fr) minmax(0, 0.35fr) minmax(0, 0.35fr);
    align-items: start;
    padding-top: 1.25em;
    width: 100%;
    margin-bottom: 0;
    position: relative;
}

.content_row > .content_column:first-child {
    grid-column: 2;
}

.content_column {
    padding: 1.25em;
    text-align: left;
    min-width: 0;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
}

.section-subtitle {
    font-size: 16px;
    color: var(--muted);
}

.embedded-container-left {
    display: flex;
    justify-content: flex-end;
    padding: 1.25em 2.5em 1.25em 1.25em;
    min-width: 0;
}

.embedded-container-left img {
    width: min(18.75em, 20vw);
    height: min(18.75em, 20vw);
    object-fit: cover;
    border-radius: 0.5em;
}

.featured-article-container .embedded-container-left img {
    width: auto;
    height: 160px;
    object-fit: unset;
    max-width: none;
    max-height: none;
}

.embedded-container-right {
    position: absolute;
    left: 65%;
    top: 1.25em;
    width: 30%;
    max-width: 25em;
    padding: 0 1.25em;
}

.embedded-container-right img {
    width: min(10em, 10vw);
    height: auto;
    border-radius: 0.5em;
}

.embedded-container-right iframe {
    display: block;
    width: min(25em, 25vw);
    height: min(12.8125em, 15vw);
    max-width: 100%;
    border: 0;
}

footer {
    flex-shrink: 0;
    background-color: #142426;
    color: #f4f7f7;
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
    margin-top: 20px;
}

.welcome-column-center .section-title, .welcome-column .section-subtitle {
    color: #000;
}

.welcome-column .section-subtitle {
    margin-bottom: 30px;
}

.name-link {
    color: var(--ink);
    text-decoration: none;
    font-size: 36px;
    font-weight: bold;
}

.name-link:hover, .name-link:focus {
    color: var(--ink);
    text-decoration: none;
}

.special-link {
    border: 2px solid var(--ink);
    color: var(--ink);
    border-radius: 10px;
    padding: 10px 15px;
    text-decoration: none;
    font-size: 16px;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: background-color 0.3s, color 0s;
    font-weight: bold;
}

.special-link:hover {
    background: #000;
    color: #fff;
}

.special-link-container {
    margin-top: 30px;
    margin-bottom: 10px;
}

/* Form styles */
.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

#login-message,
#register-message,
#update-message,
#create-message {
    margin-top: 15px;
}

.error {
    color: #d9534f;
}

/* Post and Page styles */
.post-item,
.page-item {
    border: 1px solid #ddd;
    padding: 15px 15px 8px 15px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.content_row.insights-list {
    display: block;
    padding: 2.25em 1.5em 3em;
}

.insights-list > .content_column:first-child {
    grid-column: auto;
    max-width: 56rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.insights-list h1 {
    margin: 0 0 0.3em;
    font-size: 2rem;
}

.insights-lede {
    color: var(--muted);
    margin: 0 0 1.4em;
    max-width: 36em;
}

.post-item {
    display: grid;
    grid-template-columns: 9.5em minmax(0, 1fr);
    gap: 0.2rem 1.4rem;
    align-items: start;
    padding: 1.15rem;
    margin-bottom: 1rem;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    background: var(--paper);
    overflow: hidden;
}

.post-item-body {
    min-width: 0;
}

.post-item .post-excerpt,
.post-item .post-header h2,
.post-item .post-header a {
    overflow-wrap: break-word;
}

.post-item:hover {
    border-color: rgba(27, 158, 161, 0.4);
}

.post-item-thumb {
    display: block;
}

.post-item-thumb img {
    width: 9.5em;
    height: 9.5em;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.post-item-thumb .thumb-classroom {
    object-position: center 30%;
}

.post-item-thumb .thumb-pringles {
    object-position: center 18%;
}

.post-item .post-header {
    display: block;
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 0;
    text-align: left;
}

.post-item .post-header h2 {
    margin: 0 0 0.1em;
    font-size: 1.35rem;
    line-height: 1.25;
    text-align: left;
}

.post-item .post-meta {
    margin: 0.1em 0 0.5em;
}

.post-item .post-tags {
    display: none;
}

.post-item .tag {
    font-size: 0.78em;
    padding: 3px 9px;
    margin: 0;
}

.post-item .post-excerpt {
    margin: 0.15em 0 0;
    line-height: 1.5;
}

.post-item .post-excerpt p {
    margin: 0;
    line-height: 1.5;
}

.tools-list > .content_column:first-child {
    max-width: 64rem;
}

.tools-about {
    margin: 0 0 2em;
    line-height: 1.55;
}

.category-section {
    margin-bottom: 2.25em;
}

.category-title {
    font-size: 1.15rem;
    margin: 0 0 0.75em;
}

.tool-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--paper);
}

.tool-table th {
    text-align: left;
    font-size: 0.78em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.4em 0.85em 0.65em 0;
    border-bottom: 1px solid #e4e4e4;
}

.tool-table td {
    padding: 1em 0.85em 1em 0;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.tool-table tr:last-child td {
    border-bottom: none;
}

.tool-table tbody tr:hover {
    background: #fafafa;
}

.tool-name {
    font-weight: bold;
    white-space: nowrap;
    padding-right: 1.25em;
    width: 1%;
}

.tool-desc {
    color: #333;
    line-height: 1.5;
}

.tool-table td:last-child {
    width: 1%;
    white-space: nowrap;
    padding-right: 0;
    padding-left: 1em;
    vertical-align: middle;
}

.tool-table .special-link {
    margin: 0;
}

.tool-wip {
    border-color: #bbb;
    color: #888;
    cursor: default;
    background: #f3f3f3;
}

.tool-wip:hover {
    background: #f3f3f3;
    color: #888;
}

.tool-item {
    grid-template-columns: minmax(0, 14em) minmax(0, 1fr);
    align-items: center;
}

.tool-item .post-item-thumb img {
    width: 14em;
    height: 8.75em;
    object-fit: cover;
    object-position: top center;
}

.tool-item .post-header h2 {
    font-size: 1.2rem;
}

.tool-item .special-link-container {
    margin-top: 0.85em;
    margin-bottom: 0;
}

.posts-header,
.pages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.create-post-btn,
.create-page-btn {
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.create-post-btn:hover,
.create-page-btn:hover {
    background-color: #45a049;
}

.post-header, .page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.post-header h1, .page-header h1 {
  margin: 0;
  margin-right: 15px;
}

.post-header h2,
.page-header h2 {
    margin: 0;
    margin-right: 10px;
}

.post-title-link,
.page-title-link {
    color: inherit;
    text-decoration: none;
}

.post-title-link:hover,
.page-title-link:hover {
    text-decoration: underline;
}

.status-indicator {
    margin-right: 4px;
    font-size: 0.8em;
    padding: 3px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: bold;
}

.status-indicator.draft {
    background-color: #333;
    color: white;
}

.status-indicator.published {
    background-color: #4CAF50;
    color: white;
}

.post-meta-badges {
  display: flex;
  align-items: center;
}

.index-badge {
  background-color: var(--gold-bright);
  color: var(--ink);
  font-size: 0.8em;
  padding: 3px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: bold;
  margin-left: 5px;
}

.featured-badge {
  background-color: var(--gold-bright);
  color: var(--ink);
  font-size: 0.8em;
  padding: 3px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: bold;
  margin-left: 5px;
}

.featured-article-container {
  padding: 18px 0;
  width: 100%;
}

.featured-insight {
  background: transparent;
}

.featured-tool {
  background: var(--band-tool);
}

.featured-kicker {
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.featured-insight .featured-kicker {
  color: var(--teal);
}

.featured-tool .featured-kicker {
  color: var(--gold);
}

.special-link-solid {
  background: #000;
  color: #fff;
}

.special-link-solid:hover {
  background: #fff;
  color: #000;
}

.featured-article {
  width: calc(var(--main-width) * 0.35);
  min-width: 25em;
  margin-left: calc(var(--main-width) * 0.30);
  color: #000;
}

.featured-article h2 {
  font-size: 24px;
  margin-bottom: 15px;
}

.featured-article .post-meta {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.featured-article .post-tags {
  margin-bottom: 15px;
}

.featured-article .post-excerpt {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 20px;
}

@media screen and (max-width: 740px) {
  .featured-article {
    width: 90%;
    margin-left: 5%;
    min-width: auto;
  }
}

#editor-toolbar {
  margin-bottom: 10px;
}

#editor-toolbar button {
  margin-right: 5px;
  padding: 5px 10px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
}

#editor-toolbar button:hover {
  background-color: #e0e0e0;
}

#editor-content {
  border: 1px solid #ccc;
  min-height: 200px;
  padding: 10px;
  overflow-y: auto;
}

#html-content {
  width: 100%;
  min-height: 200px;
  font-family: monospace;
  padding: 10px;
  border: 1px solid #ccc;
}

#editor-content h2 {
  font-size: 1.5em;
  margin-top: 0.83em;
  margin-bottom: 0.83em;
}

#editor-content h3 {
  font-size: 1.17em;
  margin-top: 1em;
  margin-bottom: 1em;
}

#editor-content p {
  margin-top: 1em;
  margin-bottom: 1em;
}

.edit-post-btn,
.edit-page-btn {
    margin-left: auto;
    padding: 8px 12px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9em;
    white-space: nowrap;
}

.edit-post-btn:hover,
.edit-page-btn:hover {
    background-color: #0056b3;
}

.post-meta,
.page-meta {
    color: var(--muted);
    margin-bottom: 10px;
    font-size: 0.9em;
}

.post-tags {
    margin-bottom: 4px;
}

.article-header {
            background: linear-gradient(135deg, var(--teal-soft) 0%, var(--gold-soft) 100%);
            padding: 20px 20px 30px 20px;
            text-align: center;
}

.article-content {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            line-height: 1.6;
}

.article-content a:not(.special-link-container a) {
    background-color: var(--highlight);
    color: var(--ink);
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.article-content a:not(.special-link-container a):hover {
    background-color: #FFFFFF;
    font-weight: bold;
}

.post-header a,
h2 a {
    color: #000000;
    text-decoration: underline;
    transition: font-weight 0.3s;
}

.post-header a:hover,
h2 a:hover {
    font-weight: bold;
}

.tag {
    display: inline-block;
    background-color: var(--paper);
    border: 1px solid rgba(27, 158, 161, 0.35);
    padding: 5px 10px;
    border-radius: 8px;
    margin-right: 10px;
    margin-top: 10px;
    color: var(--ink);
}

.no-tags {
    color: #999;
    font-style: italic;
    font-size: 0.85em;
}

.page-order {
    margin-left: 10px;
    font-size: 0.9em;
    color: #666;
}

/* Stats styles */
.stats-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.stat-box {
    flex-basis: 48%;
    background-color: #f0f0f0;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}

.stat-box h2 {
    margin-top: 0;
}

.stat-box p {
    font-size: 2em;
    font-weight: bold;
    margin: 0;
}

/* Edit Post styles */
.edit-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.delete-btn {
  background-color: #dc3545;
}

.delete-btn:hover {
  background-color: #c82333;
}

/* View Post styles */
.post-meta-container {
    margin-bottom: 20px;
}

.post-content {
    line-height: 1.6;
}

/* New styles for single post page */
post-header-container {
    background: linear-gradient(135deg, var(--teal-soft) 0%, var(--gold-soft) 100%);
    padding: 60px 0; /* Increased padding */
    margin-bottom: 40px; /* Increased margin */
}

.post-content {
    width: calc(var(--main-width) * 0.5); /* Increased width for better readability */
    max-width: 800px; /* Set a max-width for very large screens */
    min-width: 25em;
    margin-left: auto;
    margin-right: auto; /* Center the content */
    padding: 0; /* Add some padding on the sides */
}

.post-header h1 {
    font-size: 36px;
    margin-bottom: 20px; /* Increased margin */
    line-height: 1.2; /* Improve line height for better readability */
}

.post-header .post-meta {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px; /* Increased margin */
}

.post-header .post-tags {
  margin-bottom: 0;
}

.post-content {
    line-height: 1.8;
    font-size: 18px;
}

.post-content p {
  margin-bottom: 20px;
}

.post-content h2 {
  font-size: 28px;
  margin-top: 40px;
  margin-bottom: 20px;
}

.post-content h3 {
  font-size: 24px;
  margin-top: 30px;
  margin-bottom: 15px;
}

/* Tablet: two columns, video sits in the text flow */
@media screen and (max-width: 1100px) and (min-width: 741px) {
    .welcome-container,
    .content_row {
        grid-template-columns: minmax(10rem, 0.32fr) minmax(0, 1fr);
    }

    .welcome-column-right {
        grid-column: 2;
    }

    .welcome-column-right a {
        display: inline-block;
    }

    .content_row > .content_column:first-child {
        grid-column: 2;
    }

    .insights-list > .content_column:first-child {
        grid-column: auto;
        max-width: 56rem;
    }

    .tool-name {
        white-space: normal;
    }

    .embedded-container-right {
        position: static;
        left: auto;
        width: auto;
        max-width: 25em;
        padding: 1.25em 0;
    }

    .embedded-container-right iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        min-width: 0;
        min-height: 0;
        max-width: 25em;
        max-height: none;
    }
}

@media screen and (max-width: 740px) {
    header {
        flex-direction: column;
        align-items: center;
    }
    nav {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
        margin-top: 0px;
    }
    nav a {
        margin: 4px;
        padding: 8px 12px;
        font-size: 16px;
    }
    .welcome-container,
    .content_row {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 20px 0 0;
    }
    .welcome-column-left,
    .welcome-column-center,
    .welcome-column-right {
        width: 90%;
        padding: 10px;
        text-align: center;
        justify-content: center;
    }
    .content_row > .content_column:first-child {
        grid-column: 1;
    }
    .content_row.insights-list {
        padding: 1.25em 1.15em 2em;
    }
    .insights-list > .content_column:first-child {
        grid-column: auto;
        max-width: none;
        width: 100%;
        padding: 0;
        text-align: left;
    }
    .insights-list h1,
    .insights-lede,
    .tools-about,
    .category-title {
        text-align: left;
        margin-left: 0;
        margin-right: 0;
    }
    .content_column {
        width: 100%;
        text-align: center;
    }
    .insights-list .content_column,
    .tools-list .content_column {
        text-align: left;
    }
    .post-item {
        grid-template-columns: 1fr;
        justify-items: stretch;
        text-align: left;
        padding: 0.85rem;
        gap: 0.35rem;
    }
    .post-item .post-header h2 {
        margin-top: 0.7em;
        margin-bottom: 0.05em;
    }
    .post-item-thumb img,
    .tool-item .post-item-thumb img {
        width: 100%;
        height: 10.5rem;
        max-height: none;
        object-fit: cover;
    }
    .tool-table thead {
        display: none;
    }
    .tool-table, .tool-table tbody, .tool-table tr, .tool-table td {
        display: block;
        width: 100%;
    }
    .tool-table td {
        padding: 0.25em 0;
        border-bottom: none;
    }
    .tool-table tr {
        border: 1px solid #e4e4e4;
        border-radius: 10px;
        padding: 1rem;
        margin-bottom: 0.85em;
        text-align: left;
    }
    .tool-table td:last-child {
        padding-top: 0.75em;
        padding-left: 0;
    }
    .embedded-container-left {
        justify-content: center;
        width: 90%;
        padding: 1.25em;
    }
    .embedded-container-left img {
        width: 100%;
        height: auto;
        max-width: 100%;
        max-height: none;
    }
    .featured-article-container .embedded-container-left img {
        width: auto;
        height: 160px;
        max-width: 100%;
    }
    .embedded-container-right {
        position: static;
        left: auto;
        width: 90%;
        max-width: 100%;
        padding: 1.25em;
    }
    .embedded-container-right iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        min-width: 0;
        min-height: 0;
        max-width: 100%;
        max-height: none;
    }
    .post-header,
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .edit-post-btn,
    .edit-page-btn {
        margin-left: 0;
        margin-top: 10px;
    }
    .stat-box {
        flex-basis: 100%;
    }

    .post-content {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
        min-width: auto;
    }
    
    .post-header-container {
        padding: 40px 0;
    }
}