/**
 * christineandmathias.com Stylesheet
 * White background, black text, orange accents - inspired by Mercury theme
 * Lato font, no rounded corners
 */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Defaults; accent and highlight-bg are overridden from config/settings.php in layout */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --text-primary: #000000;
    --text-secondary: #666666;
    --text-muted: #888888;
    --text-meta: #999999; /* lighter grey for date, Edit, Reply in post/comment headers */
    --accent: #ff6600;
    --accent-hover: #ff8800;
    --highlight-bg: #ffe0cc;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
}

html {
    /* Keep a stable scrollbar so layout doesn't shift while scrolling */
    overflow-y: scroll;
}

body {
    font-family: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Hide broken images */
img[src=""],
img:not([src]) {
    display: none !important;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    width: 100%;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-image {
    height: 40px;
    width: auto;
    display: block;
}

.site-name {
    font-weight: 700;
    font-size: 24px;
    color: var(--text-primary);
    font-family: 'Lato', sans-serif;
}

.site-logo:hover .site-name {
    color: var(--accent);
}

nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--accent);
}

/* Main Content Column */
main {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-wrap: nowrap;
}

.main-content-wrapper {
    min-width: 0;
    max-width: 700px; /* Limit main content width so sidebar fits */
    width: 100%;
    flex: 1;
}

/* Sidebar */
aside.sidebar {
    width: 280px;
    flex: 0 0 280px;
    position: sticky;
    top: 12px; /* Sticky positioning so sidebar stays visible when scrolling */
    /* Reduce sticky jitter / subpixel nudging near footer */
    contain: layout paint;
    will-change: transform;
    /* TODO: Investigate/resolve Edge (Windows 11) trackpad scroll jitter where sticky sidebar nudges left/right near footer. */
}

/* Prevent long unbroken strings from widening layout */
.post-content,
.comment-content,
.post-header,
.comment-header {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-content img,
.post-content .link-preview img {
    display: block;
}

.sidebar-widget {
    background: var(--bg-primary); /* White background by default */
    border-top: 1px solid var(--border); /* Only top border by default */
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 6px 12px;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Account widget (first widget) - grey background with 4-sided border */
.sidebar-widget h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-widget ul {
    list-style: none;
}

.sidebar-widget ul li {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-widget ul li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* First section (Home/Manage.../Logout): no border between items */
.sidebar-widget:first-child ul li {
    border-bottom: none;
}

/* Recent Uploads: no border between items */
.sidebar-widget:last-child ul li {
    border-bottom: none;
}

/* Recent Comments: no border between items, tighter vertical spacing */
.sidebar-widget-recent-comments ul li {
    border-bottom: none;
    margin-bottom: 3px;
    padding-bottom: 3px;
}

.sidebar-widget-recent-comments ul li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-widget a {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
}

.sidebar-widget a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Search highlight */
.search-highlight {
    background-color: var(--highlight-bg);
    padding: 2px 0;
}

/* Keep accent colour when highlight wraps a link (e.g. hashtag on tag page) */
.post-content a .search-highlight,
.comment-content a .search-highlight {
    color: inherit;
}

.sidebar-widget .search-form {
    display: flex;
    gap: 5px;
}

.sidebar-widget .search-form input[type="text"] {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
}

.sidebar-widget .search-form input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

/* Archives dropdown – grey border, accent on focus */
.sidebar-widget .archives-select {
    display: block;
    width: 100%;
    padding: 8px 10px;
    margin: 0;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    cursor: pointer;
}

.sidebar-widget .archives-select:hover {
    border-color: var(--text-muted);
}

.sidebar-widget .archives-select:focus {
    outline: none;
    border-color: var(--accent);
}

.sidebar-widget .archives-select option {
    color: var(--text-primary);
    background: var(--bg-primary);
}

.sidebar-widget .search-form button {
    padding: 8px 15px;
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-widget .search-form button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Search page form - match sidebar search styling */
.page-search-form {
    display: flex;
    gap: 5px;
    width: 100%;
    max-width: none;
}

.page-search-form input[type="text"] {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
}

.page-search-form input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

.page-search-form button {
    padding: 8px 15px;
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.page-search-form button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.sidebar-widget .upload-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-widget .upload-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 1px solid var(--border);
}

/* Post Form */
.post-form {
    margin-bottom: 20px;
}

.post-form #newPostForm {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 20px;
    grid-template-rows: auto minmax(70px, auto) auto;
    align-items: start;
}

.post-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.post-type-selector button {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.post-type-selector button.active {
    color: var(--accent);
    background: var(--bg-secondary);
    border-color: var(--accent);
}

.post-type-selector button:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.post-input-group {
    margin-bottom: 10px;
}

/* Row 2: one type-specific box per post type (Tags / URL / Image / File), aligned with Post button */
.post-form-row2 {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.post-form-row2 .input-with-icon {
    margin-top: auto;
}

#textContentGroup {
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: 0;
}

.post-form-actions {
    /* Flatten container so its children can be grid-positioned */
    display: contents;
}

/* Error message spans full width below */
.post-form-actions #postError {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 8px;
}

/* Spinner + Post button sit to the right of URL/File/Image row */
.post-form-actions > div:last-child {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    align-self: end;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.post-input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.post-input-group p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.post-input-group input[type="text"],
.post-input-group input[type="url"],
.post-input-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.post-input-group input[type="text"]:focus,
.post-input-group input[type="url"]:focus,
.post-input-group input[type="file"]:focus,
.post-input-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.post-input-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Post form: all placeholders same light grey (main textarea + tags/url/etc below) */
.post-input-group textarea::placeholder,
.post-input-group input[type="url"]::placeholder,
.post-input-group input[type="text"]::placeholder {
    color: var(--text-secondary);
}

.post-input-group input[type="file"] {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    cursor: pointer;
    /* iOS Safari specific fixes */
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

/* When a file is chosen, show filename in primary text colour */
.post-input-group input[type="file"].has-file {
    color: var(--text-primary);
}

/* Hide the native file input button - we use custom icon instead */
.post-input-group input[type="file"]::-webkit-file-upload-button {
    display: none;
}

.post-input-group input[type="file"]::file-selector-button {
    display: none;
}

/* Input with icon wrapper */
.post-input-group .input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.post-input-group .input-icon {
    position: absolute;
    left: 12px;
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(100%);
}

/* Match URL/tags input height to file input - left padding for icon (home + edit form); fixed height to align with Post button */
.post-input-group .input-with-icon input[type="url"],
.post-input-group .input-with-icon input[type="file"],
.post-input-group .input-with-icon input[type="text"] {
    height: 40px;
    padding: 0 12px 0 40px;
    box-sizing: border-box;
}

/* Vertically center file input text ("No file chosen" / filename) like Tags and URL */
.post-input-group .input-with-icon input[type="file"] {
    line-height: 40px;
}


.post-form-actions button {
    box-sizing: border-box;
    line-height: 1.25;
    height: 40px;
    padding: 0 16px;
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.post-form-actions button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.post-form-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Single post: header row (breadcrumb + tags) */
.single-post-header-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.4rem;
    min-width: 0;
}
.single-post-header-row .post-permalink-breadcrumb {
    margin-bottom: 0;
    flex-shrink: 0;
}
.single-post-tags {
    flex: 0 1 66%;
    max-width: 66%;
    font-size: 1em;
    font-weight: normal;
    color: var(--text-secondary);
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.single-post-tags a {
    color: var(--accent);
    text-decoration: none;
}
.single-post-tags a:hover {
    text-decoration: underline;
}

/* Single post: permalink breadcrumb (year / month / day / post id) */
.post-permalink-breadcrumb {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25em;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    line-height: 1.2;
}
.post-permalink-breadcrumb a,
.post-permalink-breadcrumb .breadcrumb-label,
.post-permalink-breadcrumb .sep,
.post-permalink-breadcrumb .breadcrumb-post-id {
    font-size: 1rem;
    font-weight: bold;
}
.post-permalink-breadcrumb a {
    color: var(--accent);
}
.post-permalink-breadcrumb a:hover {
    text-decoration: underline;
}
.post-permalink-breadcrumb .sep {
    user-select: none;
}

/* Edit post form (single-post page) – same 2-column grid as home */
.edit-post-form {
    margin-bottom: 20px;
}

/* Edit post: light orange background on main content text box only */
.edit-post-form #editTextContentGroup textarea {
    background-color: var(--highlight-bg);
}

.edit-post-form form {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 20px;
    grid-template-rows: auto minmax(70px, auto) auto;
    align-items: start;
}

.edit-post-form #editTextContentGroup {
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: 0;
}

.edit-post-form .post-form-row2 {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.edit-post-form .post-form-row2 .input-with-icon {
    margin-top: auto;
}

.edit-form-actions {
    display: contents;
}

.edit-form-actions .error-message,
.edit-form-actions #editPostError {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 8px;
}

.edit-form-actions > div:last-child {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    align-self: end;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.edit-form-actions .error-message {
    flex: none;
    min-width: 0;
}

.edit-cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 12px 24px;
    line-height: 1.25;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.edit-cancel-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Edit post form: Cancel and Save same size as Tag/URL/Upload row (40px), same width, narrower */
.edit-post-form .edit-cancel-btn,
.edit-post-form .post-form-actions button {
    height: 40px;
    padding: 0 16px;
    width: 90px;
    min-width: 90px;
    box-sizing: border-box;
}

.edit-post-form .edit-cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Comment inline edit: Cancel/Save (same style as Post/Search, slightly smaller) */
.comment-edit-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.comment-edit-actions .comment-edit-cancel,
.comment-edit-actions .comment-edit-save {
    padding: 6px 14px;
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid;
}

.comment-edit-actions .comment-edit-cancel {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border);
}

.comment-edit-actions .comment-edit-cancel:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.comment-edit-actions .comment-edit-save {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.comment-edit-actions .comment-edit-save:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.comment-edit-actions .comment-edit-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.post-form-actions .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}

.post-form-actions .spinner.active {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
    /* Front page: keep Post button to the right of Tags/Link/Image/File box on narrow screens */
    .post-form #newPostForm {
        column-gap: 10px;
    }

    .post-form-row2 {
        min-width: 0; /* Allow input area to shrink so button stays visible */
    }

    .edit-post-form form {
        grid-template-columns: 1fr;
        row-gap: 10px;
    }

    .edit-post-form #editTextContentGroup,
    .edit-post-form .post-form-row2 {
        grid-column: 1;
    }

    .edit-form-actions > div:last-child {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
    }

    .edit-form-actions .error-message,
    .edit-form-actions #editPostError {
        grid-column: 1;
        grid-row: auto;
    }
}

/* Posts List */
.posts-list {
    list-style: none;
}

.post-item {
    background: var(--bg-primary); /* White background */
    border-top: 1px solid var(--border); /* Only top border */
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 6px 12px;
    margin-bottom: 4px;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
    padding-bottom: 0;
    border-bottom: none; /* No line under name/date section */
    font-size: 13px;
    line-height: 1;
}

.post-author {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 1em;
    line-height: 1;
}

.post-author:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.post-meta {
    color: var(--text-meta);
    font-size: 1em;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.post-meta a {
    color: var(--text-meta);
    text-decoration: none;
}

.post-meta a:hover {
    color: var(--accent);
}

.post-meta .permalink-icon,
.comment-meta .permalink-icon {
    filter: grayscale(100%);
    text-decoration: none;
    font-size: 1em;
    line-height: 1;
}

.post-meta .permalink-icon:hover,
.comment-meta .permalink-icon:hover {
    filter: grayscale(100%); /* keep grey on hover */
}

.post-meta .edit-icon,
.comment-meta .edit-icon {
    font-size: 1em;
    line-height: 1;
}

.post-meta a.edit-icon,
.comment-meta .edit-icon {
    text-decoration: none;
}

.post-meta a.edit-icon:hover,
.post-meta .reply-icon:hover,
.comment-meta .edit-comment-btn:hover,
.comment-meta .reply-icon:hover {
    color: var(--accent);
}

.comment-meta .edit-comment-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-size: inherit;
    line-height: 1;
    color: inherit;
    font-family: inherit;
}

.post-meta .reply-icon {
    background: none;
    border: none;
    color: var(--text-meta);
    cursor: pointer;
    font-size: 1em;
    line-height: 1;
    padding: 0;
    font-family: inherit;
}

.post-content {
    margin-bottom: 6px;
    line-height: 1.6;
    word-wrap: break-word;
}

.post-content p {
    margin-bottom: 6px; /* Reduced paragraph spacing */
}

.post-content ul,
.post-content ol {
    margin: 10px 0;
    padding-left: 1.5em;
}

.post-content ul {
    list-style-type: disc;
}

.post-content ol {
    list-style-type: decimal;
}

.post-content li {
    margin-bottom: 4px;
    display: list-item;
}

.post-content ul ul,
.post-content ol ul {
    list-style-type: circle;
    margin-top: 4px;
}

.post-content ol ol {
    list-style-type: lower-alpha;
    margin-top: 4px;
}

.post-content a {
    color: var(--accent);
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    cursor: pointer;
    border: 1px solid var(--border);
}

.post-content .link-preview {
    border: 1px solid var(--border);
    padding: 12px;
    margin: 12px 0;
    background: var(--bg-secondary);
}

.post-content .link-preview img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
    display: block;
    border: 1px solid var(--border);
}

.post-content .link-preview h3 {
    margin-bottom: 8px;
    font-size: 18px;
}

.post-content .link-preview h3 a {
    color: var(--accent);
}

.post-content .link-preview p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.post-tags {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.post-tags a {
    color: var(--accent);
    text-decoration: none;
    margin-right: 10px;
    font-size: 14px;
}

.post-tags a:hover {
    text-decoration: underline;
}

.post-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.post-actions button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.post-actions button:hover {
    color: var(--accent);
    background: var(--bg-secondary);
}

/* Comments */
/* Comments: same horizontal span as post content (indent + width = post content width), so Edit/Reply align */
.comments-section {
    margin-top: 6px;
    padding-top: 0;
    border-top: none;
    margin-left: 24px;
    width: calc(100% - 12px); /* Ends at post content right edge (post-item has 12px right padding) */
    box-sizing: border-box;
}

.comments-list {
    list-style: none;
    margin-top: 4px;
}

.comment-item {
    padding: 4px 12px;
    margin-bottom: 4px;
    margin-left: 0;
    background: var(--bg-primary);
    border-left: 2px solid var(--border);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
    font-size: 13px;
    line-height: 1;
}

.comment-author {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 1em;
    line-height: 1;
}

.comment-author:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.comment-meta a.comment-permalink {
    color: var(--text-meta);
    text-decoration: none;
}
.comment-meta a.comment-permalink:hover {
    color: var(--accent);
}

.comment-meta {
    color: var(--text-meta);
    font-size: 1em;
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.comment-meta .reply-icon {
    background: none;
    border: none;
    color: var(--text-meta);
    cursor: pointer;
    font-size: 1em;
    padding: 0;
    margin: 0;
    line-height: 1;
    font-family: inherit;
}

.comment-content {
    color: var(--text-primary);
    line-height: 1.6;
    word-wrap: break-word;
}

/* Posts or comments that contain only 1–3 emojis: larger font */
.emoji-only {
    font-size: 1.75em;
    line-height: 1.3;
}

.comment-content ul,
.comment-content ol {
    margin: 8px 0;
    padding-left: 1.5em;
}

.comment-content ul {
    list-style-type: disc;
}

.comment-content ol {
    list-style-type: decimal;
}

.comment-content li {
    margin-bottom: 2px;
    display: list-item;
}

.comment-content a {
    color: var(--accent);
    text-decoration: none;
}

.comment-content a:hover {
    text-decoration: underline;
}

/* Comment inline edit: light orange background (same as search/tag highlight), narrow light grey border */
.comment-content:has(.comment-edit-textarea) {
    background-color: var(--highlight-bg);
    border: 1px solid var(--border);
    padding: 8px;
}

.comment-edit-textarea {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.comment-edit-textarea:focus {
    outline: none;
}

.comment-form {
    margin-top: 15px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    min-height: 80px;
    resize: vertical;
    -webkit-appearance: none;
    appearance: none;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-form-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.comment-form-actions button {
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
    padding: 8px 16px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.comment-form-actions button:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

/* Pagination (home) */
.pagination {
    margin-top: 30px;
    padding-top: 20px;
    text-align: center;
}

.pagination-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
}

.pagination-list li {
    margin: 0;
    padding: 0;
}

.pagination-num,
.pagination-prev,
.pagination-next {
    display: inline-block;
    min-width: 36px;
    padding: 8px 12px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    transition: border-color 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.pagination-num:hover,
.pagination-prev:hover,
.pagination-next:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.pagination-num.pagination-current {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    cursor: default;
}

.pagination-num.pagination-current:hover {
    border-color: var(--accent);
    color: white;
}

.pagination-disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-disabled:hover {
    border-color: var(--border);
    color: var(--text-secondary);
}

.pagination-ellipsis {
    display: inline-block;
    padding: 8px 4px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Pagination: smaller on narrow screens (e.g. iPhone) so it fits */
@media (max-width: 600px) {
    .pagination-list {
        gap: 4px;
    }

    .pagination-num,
    .pagination-prev,
    .pagination-next {
        min-width: 28px;
        padding: 6px 8px;
        font-size: 12px;
    }

    .pagination-ellipsis {
        padding: 6px 2px;
        font-size: 12px;
    }
}

/* Admin: User Management */
.admin-add-user {
    margin-bottom: 30px;
}

.admin-user-form .post-input-group {
    margin-bottom: 15px;
}

.admin-user-form input[type="text"],
.admin-user-form input[type="email"],
.admin-user-form input[type="password"] {
    width: 100%;
    max-width: 400px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    box-sizing: border-box;
}

.admin-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.admin-btn {
    padding: 10px 20px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.admin-btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.admin-btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.admin-btn-edit:hover,
.admin-btn-cancel:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.admin-btn-delete:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Top "Delete selected" button: orange with white text, white with orange on hover */
/* Same width for top "Delete selected" and row "Delete post" so they line up when right-aligned */
.admin-posts-actions .admin-btn-delete,
.admin-posts-table .col-actions .admin-btn-delete {
    width: 142px;
    box-sizing: border-box;
}
.admin-posts-actions .admin-btn-delete {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.admin-posts-actions .admin-btn-delete:hover {
    background: white;
    color: var(--accent);
    border-color: var(--accent);
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.admin-table-wrap {
    overflow-x: auto;
    margin-top: 15px;
}

.admin-users-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-users-table th,
.admin-users-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.admin-users-table th {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 14px;
}

.admin-users-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* Admin: Edit User Modal */
.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.admin-modal.hidden {
    display: none;
}

.admin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.admin-modal-content {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    padding: 24px;
    max-width: 440px;
    width: 100%;
}

.admin-modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.admin-modal-content .post-input-group {
    margin-bottom: 15px;
}

.admin-modal-content input[type="text"],
.admin-modal-content input[type="email"],
.admin-modal-content input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    box-sizing: border-box;
}

.admin-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* No-sidebar layout: match home page width (main 700px + gap 30px + sidebar 280px = 1010px) */
body.layout-no-sidebar main .main-content-wrapper {
    width: 1010px;
    max-width: 100%;
    min-width: 0;
}
/* Manage Files: force inner wrapper to full width (override any conflicting .main-content-wrapper) */
body.layout-no-sidebar main .main-content-wrapper.admin-files-full {
    width: 1010px;
    max-width: 100%;
    min-width: 0;
    display: block;
}

/* Photos gallery: full-width grid, no sidebar */
.photos-gallery-wrapper {
    max-width: 100%;
    width: 100%;
}
.photos-breadcrumb {
    margin-bottom: 1em;
    font-size: 0.95rem;
}
.photos-breadcrumb a {
    color: var(--accent);
}
.photos-breadcrumb a:hover {
    color: var(--accent-hover);
}
.photos-breadcrumb .sep {
    color: var(--text-secondary);
}
.photos-empty {
    text-align: center;
    color: var(--text-secondary);
}
.photos-grid {
    display: grid;
    grid-template-columns: repeat(4, 256px);
    gap: 32px;
    list-style: none;
    margin: 0 0 1.5em;
    padding: 0;
    justify-content: start;
}
.photos-grid-item {
    margin: 0;
}
.photos-grid-link {
    display: block;
    position: relative;
    width: 256px;
    height: 256px;
    overflow: hidden;
    border-radius: 2px;
}
.photos-grid-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.photo-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-primary);
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.photos-grid-link:hover .photo-caption,
.photos-grid-link:focus .photo-caption {
    opacity: 1;
}

@media (max-width: 1200px) {
    .photos-grid {
        grid-template-columns: repeat(3, 256px);
    }
}
@media (max-width: 900px) {
    .photos-grid {
        grid-template-columns: repeat(2, 256px);
    }
}
@media (max-width: 600px) {
    .photos-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .photos-grid-link {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        max-width: 320px;
        margin: 0 auto;
    }
    .photos-grid-link img {
        width: 100%;
        height: 100%;
    }
}

/* Admin: Manage Posts & Manage Files (shared layout) */
.admin-posts-full,
.admin-files-full {
    max-width: 100%;
    width: 100%;
}
.admin-posts-full .admin-table-wrap,
.admin-files-full .admin-table-wrap {
    margin-top: 8px;
}
.admin-posts-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.admin-posts-header-row h2 {
    margin: 0;
}
.admin-posts-actions {
    margin: 0;
    padding-right: 8px;
}
/* Search under title: same look as sidebar search */
.admin-posts-search-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
    max-width: 420px;
}
.admin-posts-search-row .admin-posts-search-input {
    flex: 1;
    min-width: 0;
    padding: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
}
.admin-posts-search-row .admin-posts-search-input:focus {
    outline: none;
    border-color: var(--accent);
}
.admin-posts-search-row .admin-posts-search-btn {
    padding: 8px 15px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
    cursor: pointer;
}
.admin-posts-search-row .admin-posts-search-btn:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.admin-posts-search-row .admin-posts-search-clear {
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
}
.admin-posts-search-row .admin-posts-search-clear:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}
.admin-posts-table .admin-th-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.admin-filter-select {
    font-family: 'Lato', sans-serif;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
}
.admin-filter-select.admin-filter-in-header {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 4px 6px;
    font-size: 12px;
}
.admin-posts-table th .admin-filter-in-header {
    margin-top: 0;
}
.admin-posts-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-posts-table th,
.admin-posts-table td {
    text-align: left;
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
    line-height: 1.3;
    font-size: 14px;
}
/* No line between data row and content row (same post) */
.admin-posts-table tbody tr.admin-post-data-row:has(+ tr.admin-post-content-row) td {
    border-bottom: none;
}
.admin-posts-table th {
    color: var(--text-secondary);
    font-weight: 700;
    vertical-align: bottom;
}
.admin-posts-table tbody tr.admin-post-data-row:hover {
    background: var(--bg-secondary);
}
.admin-posts-table .col-check { width: 1%; white-space: nowrap; }
.admin-posts-table .col-year { width: 4%; }
.admin-posts-table .col-month { width: 4%; }
.admin-posts-table .col-day { width: 4%; }
.admin-posts-table .col-id { width: 5%; }
.admin-posts-table .col-type { width: 5%; white-space: nowrap; }
.admin-posts-table .col-user { width: 5%; white-space: nowrap; }
.admin-posts-table .col-comments { width: 4%; }
.admin-posts-table .col-tags { width: 15%; white-space: nowrap; }
.admin-posts-table .col-actions { width: 1%; white-space: nowrap; text-align: center; }
.admin-posts-table .col-id a {
    color: var(--accent);
    text-decoration: none;
}
.admin-posts-table .col-id a:hover {
    text-decoration: underline;
}
.admin-post-content-row td {
    vertical-align: top;
}
.admin-post-content-row:hover {
    background: transparent;
}
.admin-post-content-spacer {
    width: 1%;
    padding-left: 8px;
    padding-right: 8px;
    vertical-align: top;
}
.admin-post-content-cell {
    color: #888;
    padding: 4px 8px 6px;
    border-bottom: none;
    vertical-align: top;
    overflow: hidden;
}
/* Content row (truncated excerpt) stays smaller than main table rows */
.admin-posts-table .admin-post-content-cell {
    font-size: 13px;
}
.admin-post-content-inner {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.3;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.admin-post-content-inner:empty::after {
    content: '\00a0';
}
.admin-post-content-more {
    color: #888;
    text-decoration: none;
    white-space: nowrap;
}
.admin-post-content-more:hover {
    color: var(--accent);
    text-decoration: none;
}

/* Admin: Manage Files – same styling as Manage Posts table, different column widths */
.admin-files-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-files-table th,
.admin-files-table td {
    text-align: left;
    padding: 5px 8px;
    border-bottom: 1px solid var(--border);
    line-height: 1.3;
    font-size: 14px;
}
.admin-files-table th {
    color: var(--text-secondary);
    font-weight: 700;
    vertical-align: bottom;
}
.admin-files-table tbody tr.admin-file-data-row:hover {
    background: var(--bg-secondary);
}
.admin-files-table .col-check { width: 1%; white-space: nowrap; }
.admin-files-table .col-thumb { width: 6%; vertical-align: middle; }
.admin-files-table .col-filename { width: 35%; }
.admin-files-table .col-filetype { width: 8%; white-space: nowrap; }
.admin-files-table .col-dimensions { width: 10%; white-space: nowrap; text-align: center; }
.admin-files-table .col-size { width: 8%; white-space: nowrap; text-align: right; }
.admin-files-table .col-date { width: 12%; white-space: nowrap; }
.admin-files-table .col-actions { width: 12%; min-width: 290px; white-space: nowrap; text-align: center; }

/* Mini thumbnail: 60px wide, crop to show top 45% (height 45px) */
.admin-file-thumb-wrap {
    width: 60px;
    height: 45px;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: var(--bg-secondary);
}
.admin-file-thumb {
    width: 60px;
    height: 45px;
    object-fit: cover;
    object-position: top center;
    display: block;
}
.admin-file-thumb-placeholder {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 45px;
}
.admin-files-table .col-filename a {
    color: var(--accent);
    text-decoration: none;
}
.admin-files-table .col-filename a:hover {
    text-decoration: underline;
}
.admin-files-actions .admin-btn-delete,
.admin-files-table .col-actions .admin-btn-delete {
    width: 142px;
    box-sizing: border-box;
}
.admin-files-table .col-actions .admin-btn-replace {
    width: 142px;
    box-sizing: border-box;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.admin-files-actions .admin-btn-delete {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.admin-files-actions .admin-btn-delete:hover {
    background: white;
    color: var(--accent);
    border-color: var(--accent);
}
.admin-files-table .col-actions .admin-btn-replace:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.admin-files-table .col-actions .admin-file-actions-wrap {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: nowrap;
}
/* Top "Delete selected" on Manage Files: same width as Manage Posts for alignment */
.admin-files-full .admin-posts-actions .admin-btn-delete {
    width: 142px;
}

/* Footer */
footer {
    width: 100%;
    margin-top: 50px;
    padding-top: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 900px) {
    main {
        flex-direction: column;
    }

    .main-content-wrapper {
        max-width: 100%;
    }

    aside.sidebar {
        width: 100%;
        position: static; /* Remove sticky on mobile */
    }

    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 24px;
    }

    nav {
        font-size: 12px;
        gap: 15px;
    }

    .post-item {
        padding: 6px 12px;
    }
}

/* iOS Safari: fixes that differ from desktop (padding/margin stay as base). */
@supports (-webkit-touch-callout: none) {
    input[type="text"],
    input[type="url"],
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    /* Reply box: 16px so iOS doesn't zoom in; without this, zoom persists after Post */
    .comment-form textarea {
        font-size: 16px !important;
    }

    button {
        min-height: 44px; /* iOS touch target minimum */
    }

    /* Keep header row compact: don't grow Reply/Edit to 44px */
    .post-header button,
    .comment-header button {
        min-height: 0 !important;
    }

    /* Post form: keep button same height as Tags/URL/Image/File input (40px) */
    .post-form-actions button,
    .edit-post-form .post-form-actions button {
        min-height: 0 !important;
        height: 40px !important;
    }
}

/* Inline link preview card (hover over plain URLs in content) */
.inline-link-preview-card {
    max-width: 320px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    pointer-events: auto;
}

.inline-link-preview-img {
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: cover;
    display: block;
}

.inline-link-preview-body {
    padding: 10px 12px;
}

.inline-link-preview-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.inline-link-preview-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.inline-link-preview-card--twitter .twitter-embed-inline {
    margin: 0;
    min-width: 0;
}

.twitter-embeds {
    margin-top: 12px;
    clear: both;
    overflow: hidden;
}

.twitter-embed-block {
    position: relative;
    margin-bottom: 12px;
    overflow: hidden;
}

.twitter-embed-block:last-child {
    margin-bottom: 0;
}

.twitter-embed-block iframe {
    max-width: 100%;
}

/* Spotify embeds */
.spotify-embeds {
    margin-top: 12px;
    clear: both;
}

.spotify-embed-block {
    position: relative;
    margin-bottom: 12px;
    max-width: 100%;
}

.spotify-embed-block:last-child {
    margin-bottom: 0;
}

.spotify-embed-block iframe {
    max-width: 100%;
    border-radius: 12px;
}

.spotify-link-card {
    display: inline-block;
    margin-right: 12px;
    margin-bottom: 8px;
    padding: 8px 14px;
    background: #fff;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.spotify-link-card:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    text-decoration: none;
}

/* Maps embeds (Google Maps iframe + link cards, Apple Maps link cards) */
.maps-embeds {
    margin-top: 12px;
    clear: both;
}

.google-maps-embed-block {
    position: relative;
    margin-bottom: 12px;
    max-width: 100%;
}

.google-maps-embed-block iframe {
    width: 100%;
    max-width: 100%;
    height: 450px;
    border: 0;
    border-radius: 4px;
}

.map-embed-card {
    display: inline-block;
    margin-right: 12px;
    margin-bottom: 8px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    color: var(--accent);
    text-decoration: none;
}

.map-embed-card:hover {
    background: var(--highlight-bg);
    color: var(--accent-hover);
}

/* Instagram embeds (post/reel cards via Meta oEmbed) */
.instagram-embeds {
    margin-top: 12px;
    clear: both;
}

.instagram-embed-block {
    position: relative;
    margin-bottom: 12px;
    max-width: 100%;
}

.instagram-embed-block:last-child {
    margin-bottom: 0;
}

.instagram-embed-block iframe,
.instagram-embed-block blockquote.instagram-media,
.instagram-embed-block * {
    max-width: 100%;
}

.instagram-link-card {
    display: inline-block;
    margin-right: 12px;
    margin-bottom: 8px;
    padding: 8px 14px;
    background: #fff;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.instagram-link-card:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    text-decoration: none;
}

/* YouTube embeds (oEmbed iframe) – full width of main content, 16:9 aspect ratio */
.youtube-embeds {
    margin-top: 12px;
    clear: both;
    width: 100%;
}

.youtube-embed-block {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    margin-bottom: 12px;
}

.youtube-embed-block:last-child {
    margin-bottom: 0;
}

.youtube-embed-block iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.youtube-link-card {
    display: inline-block;
    margin-right: 12px;
    margin-bottom: 8px;
    padding: 8px 14px;
    background: #fff;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.youtube-link-card:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: #fff;
    text-decoration: none;
}

.inline-link-preview-card--spotify .spotify-embed-inline,
.inline-link-preview-card--google-maps .google-maps-embed-inline,
.inline-link-preview-card--instagram .instagram-embed-inline,
.inline-link-preview-card--youtube .youtube-embed-inline {
    margin: 0;
    min-width: 0;
}

.inline-link-preview-card--spotify .spotify-embed-inline iframe,
.inline-link-preview-card--google-maps .google-maps-embed-inline iframe,
.inline-link-preview-card--instagram .instagram-embed-inline iframe,
.inline-link-preview-card--instagram .instagram-embed-inline blockquote.instagram-media,
.inline-link-preview-card--youtube .youtube-embed-inline iframe {
    max-width: 100%;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Error messages */
.error-message {
    color: #cc0000;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Success messages */
.success-message {
    color: var(--accent);
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

.success-message.show {
    display: block;
}
