/* ウミック日記 - style.css
   Colors taken from umikku.jp: nav blue #3366cc, accent red #cc0001 */

:root {
    --brand-blue: #3366cc;
    --brand-blue-dark: #274e9e;
    --brand-red: #cc0001;
    --text-main: #333333;
    --text-muted: #808080;
    --border-color: #ddd;
    --bg-page: #f5f5f5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Hiragino Kaku Gothic Pro", "Hiragino Sans", "Meiryo", "MS PGothic", Verdana, Arial, sans-serif;
    color: var(--text-main);
    background: var(--bg-page);
    line-height: 1.7;
}

a {
    color: var(--brand-blue-dark);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
}
.site-header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.site-logo img {
    max-height: 48px;
    width: auto;
}
.site-logo-text {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-main);
}
.back-to-main {
    font-size: 13px;
    color: var(--text-muted);
}
.all-posts-link {
    display: none;
}

/* Nav */
.site-nav {
    background: var(--brand-blue);
    background: linear-gradient(180deg, var(--brand-blue) 0%, var(--brand-blue) 100%);
}
.site-nav-inner {
    max-width: 1000px;
    margin: 0 auto;
}
.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}
.site-nav li a {
    display: block;
    padding: 12px 18px;
    color: #fff;
    font-size: 16px;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.site-nav li a:hover {
    background: rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

/* Main layout */
.site-main {
    max-width: 1000px;
    margin: 24px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 720px) {
    .site-main {
        grid-template-columns: 1fr;
        margin-bottom: 0;
    }
    .site-nav ul {
    justify-content: space-between;
    padding: 10px;
    }
    .site-nav ul li{
        width: calc(100% / 3);
        box-sizing: border-box;
    }
    .site-nav li a {
    padding: 0;
    font-size: 13px;
    }
    .all-posts-link {
        display: block;
    }
    /* Calendar-onward zone: full-bleed light band so it reads as a distinct
       section from the post list above, leading into the (dark) footer. */
    .sidebar {
        display: flex;
        flex-direction: column;
        gap: 16px;
        background: #e9f1fb;
        margin: 0 -16px;
        padding: 16px 16px 24px;
    }
    .calendar-box {
        order: -1;
        margin-top: 0;
    }
    .site-footer {
        margin-top: 0;
    }
}

.page-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--brand-blue);
}

/* Sidebar category list (matches reference site's simple list look) */
.sidebar-box {
    background: #fff;
    border: 1px solid var(--border-color);
}
.sidebar-box h2 {
    font-size: 14px;
    margin: 0;
    padding: 10px 14px;
    background: #fafafa;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar-box li {
    border-bottom: 1px solid var(--border-color);
}
.sidebar-box li:last-child {
    border-bottom: none;
}
.sidebar-box li a {
    display: block;
    padding: 12px 14px;
    color: var(--text-main);
    font-size: 14px;
}
.sidebar-box li a:hover {
    background: #f5f8ff;
    text-decoration: none;
    color: var(--brand-blue-dark);
}
.sidebar-box li a.is-active {
    color: var(--brand-blue-dark);
    font-weight: bold;
}

/* Sidebar calendar */
.calendar-box {
    margin-top: 16px;
}
.cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}
.cal-nav-prev,
.cal-nav-next {
    padding: 2px 8px;
    color: var(--brand-blue-dark);
    font-size: 13px;
}
.cal-nav-title {
    font-size: 13px;
    font-weight: bold;
}
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 8px;
    gap: 2px;
}
.cal-weekday {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    padding-bottom: 4px;
}
.cal-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
}
.cal-day-num,
.cal-day-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 12px;
    color: var(--text-main);
    border-radius: 3px;
}
.cal-day-empty {
    color: var(--text-muted);
}
.cal-day-link {
    color: var(--brand-blue-dark);
    font-weight: bold;
    background: #f5f8ff;
}
.cal-day-link:hover {
    background: #e8eefc;
    text-decoration: none;
}
.cal-day-link.is-active-date {
    background: var(--brand-blue-dark);
    color: #fff;
}
.cal-day-num.is-today,
.cal-day-link.is-today {
    box-shadow: inset 0 0 0 1px var(--brand-red);
}
.cal-day-dots {
    display: flex;
    gap: 2px;
    height: 6px;
    margin-top: 2px;
}
.cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand-blue-dark);
}
.cal-dot.cat-ikada {
    background: #1e7d4d;
}
.cal-dot.cat-rental {
    background: var(--brand-blue-dark);
}
.cal-dot.cat-fune {
    background: #b25a06;
}
.cal-legend {
    list-style: none;
    margin: 0;
    padding: 4px 10px 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cal-legend li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 6px;
    padding-left: 20px;
}
.cal-legend .cal-dot {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
}
.cal-clear {
    text-align: center;
    padding: 8px 10px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
}

/* Post list */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 20px;
}
.pager-edge,
.pager-prev,
.pager-next {
    color: var(--brand-blue-dark);
    font-size: 14px;
    font-weight: bold;
}
.pager-edge.is-disabled,
.pager-prev.is-disabled,
.pager-next.is-disabled {
    color: var(--text-muted);
}
.pager-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}
.pager-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 4px;
    font-size: 13px;
    color: var(--brand-blue-dark);
    border: 1px solid var(--border-color);
    background: #fff;
}
.pager-num:hover {
    text-decoration: none;
    background: #eef2fb;
}
.pager-num.is-current {
    background: var(--brand-blue-dark);
    border-color: var(--brand-blue-dark);
    color: #fff;
    font-weight: bold;
}
.pager-ellipsis {
    color: var(--text-muted);
    font-size: 13px;
    padding: 0 2px;
}
.post-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 16px;
}
.post-card.is-pinned {
    border: 1px solid var(--brand-red);
    background: #fff8f8;
}
.pinned-badge {
    display: inline-block;
    background: var(--brand-red);
    color: #fff;
    font-size: 12px;
    padding: 3px 8px;
    margin-bottom: 8px;
}
.post-category {
    display: inline-block;
    background: #eef2fb;
    color: var(--brand-blue-dark);
    font-size: 12px;
    padding: 2px 8px;
}
.post-category-corner {
    position: absolute;
    top: 16px;
    right: 16px;
}
.post-category.cat-ikada {
    background: #e3f2ea;
    color: #1e7d4d;
}
.post-category.cat-rental {
    background: #e8eefc;
    color: var(--brand-blue-dark);
}
.post-category.cat-fune {
    background: #fdeee2;
    color: #b25a06;
}
.post-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
}
.post-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 13px;
    color: var(--text-main);
    background: #f5f8ff;
    padding: 8px 10px;
    margin-bottom: 10px;
}
.post-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.post-thumb {
    max-width: 180px;
}
.post-thumb img {
    cursor: zoom-in;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    z-index: 1000;
}
.lightbox-overlay[hidden] {
    display: none;
}
.lightbox-content {
    position: relative;
    max-width: 100%;
    max-height: 100%;
}
.lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 80px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    cursor: zoom-out;
}
.lightbox-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222;
    border: 2px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
body.lightbox-open {
    overflow: hidden;
}
.catch-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    font-size: 14px;
}
.catch-table th,
.catch-table td {
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
}
.catch-table thead th {
    background: #f5f8ff;
    color: var(--brand-blue-dark);
    font-size: 13px;
}
.catch-table .catch-col-group {
    width: 30%;
    font-weight: bold;
    background: #fafafa;
}
.catch-table tr.catch-group-start td {
    border-top: 2px solid var(--border-color);
}
.post-excerpt {
    font-size: 14px;
    color: var(--text-main);
    white-space: pre-wrap;
}
.empty-state {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
}

/* Single post */
.post-detail {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 20px;
}
.post-detail .post-photo {
    margin-bottom: 16px;
}
.post-detail .post-body {
    white-space: pre-wrap;
    font-size: 15px;
}
.back-link {
    display: inline-block;
    margin-top: 16px;
    font-size: 14px;
}

/* Footer */
.site-footer {
    background: #333;
    color: #ccc;
    margin-top: 40px;
}
.site-footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px;
    font-size: 12px;
    text-align: center;
}

/* Forms (admin) */
.admin-wrap {
    max-width: 720px;
    margin: 40px auto;
    padding: 0 16px;
}
.admin-box {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 24px;
}
.admin-box h1 {
    font-size: 18px;
    margin-top: 0;
}
.form-row {
    margin-bottom: 16px;
}
.form-row label {
    display: block;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 6px;
}
.form-row input[type="text"],
.form-row input[type="password"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 16px;
    font-family: inherit;
}
.form-row textarea {
    min-height: 180px;
    resize: vertical;
}
.editor-btn {
    padding: 6px 10px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}
.editor-btn:hover {
    background: #f5f5f5;
}
#catch-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 10px;
}
.catch-group-block {
    border: 1px solid var(--border-color);
    background: #fafbff;
    padding: 10px;
}
.catch-group-header {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.catch-group-header input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 16px;
    font-family: inherit;
}
.catch-fish-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.catch-fish-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: stretch;
}
.catch-fish-row input {
    padding: 10px;
    border: 1px solid #ccc;
    font-size: 16px;
    font-family: inherit;
}
.catch-fish-row input[name*="[species]"] {
    flex: 2 1 140px;
}
.catch-fish-row input[name*="[size]"],
.catch-fish-row input[name*="[count]"] {
    flex: 1 1 90px;
}
.btn-remove-fish,
.btn-remove-group {
    padding: 10px 14px;
    border: 1px solid #ccc;
    background: #fff;
    color: var(--brand-red);
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}
.btn-remove-fish:hover,
.btn-remove-group:hover {
    background: #fdecea;
}
.btn-add-fish {
    width: 100%;
}
#add-catch-group {
    width: 100%;
    margin-top: 4px;
}
.photo-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}
.photo-thumb-item {
    border: 1px solid var(--border-color);
    padding: 6px;
    text-align: center;
}
.photo-thumb-item img {
    margin: 0 auto 6px;
    max-height: 100px;
    width: auto;
}
.photo-remove-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 13px;
    font-weight: normal;
    color: var(--brand-red);
}
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-check label {
    margin: 0;
    font-weight: normal;
}
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--brand-blue);
    color: #fff;
    border: none;
    font-size: 14px;
    cursor: pointer;
}
.btn:hover {
    background: var(--brand-blue-dark);
    text-decoration: none;
}
.btn-danger {
    background: var(--brand-red);
}
.btn-danger:hover {
    background: #a00;
}
.btn-secondary {
    background: #999;
}
.btn-secondary:hover {
    background: #777;
}
.alert {
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-error {
    background: #fdecea;
    color: var(--brand-red);
    border: 1px solid #f5c2c0;
}
.alert-success {
    background: #eaf7ea;
    color: #2a7a2a;
    border: 1px solid #b9e0b9;
}

/* Admin list table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.admin-table th,
.admin-table td {
    border: 1px solid var(--border-color);
    padding: 10px;
    font-size: 14px;
    text-align: left;
    vertical-align: top;
}
.admin-table th {
    background: #fafafa;
}
.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}
.filter-tabs a {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-main);
    font-size: 13px;
}
.filter-tabs a:hover {
    background: #f5f8ff;
    text-decoration: none;
}
.filter-tabs a.is-active {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #fff;
}
.action-links a {
    margin-right: 10px;
    font-size: 13px;
}
.link-button {
    background: none;
    border: none;
    padding: 0;
    margin-right: 10px;
    font-size: 13px;
    color: var(--brand-red);
    cursor: pointer;
    text-decoration: underline;
    font-family: inherit;
}


/* Article typography and group-specific galleries. */
.post-card .catch-group-title { color: #333333; font-size: 14px; }
.public-catch-group { margin: 18px 0; min-width: 0; }
.catch-group-title { margin: 0 0 8px; overflow-wrap: anywhere; }
.public-catch-group .catch-table { table-layout: fixed; width: 100%; }
.public-catch-group .catch-table td { overflow-wrap: anywhere; }
.group-photo-upload { margin-top: 14px; padding-top: 12px; border-top: 1px solid #ddd; }
.photo-slot-hint, .upload-help { color: #666; font-size: 13px; }
.text-style-controls { border: 1px solid #ddd; border-radius: 6px; padding: 16px; }
#text-style-preview { padding: 12px; background: #fff; border: 1px solid #ddd; overflow-wrap: anywhere; }
.photo-upload input[type="file"] { max-width: 100%; }

/* Per-field catch text and simple color selectors. */
.catch-fish-row .catch-field { flex: 1 1 90px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.catch-fish-row .catch-field:first-child { flex: 2 1 140px; }
.catch-fish-row .catch-field input { width: 100%; min-width: 0; flex: none; box-sizing: border-box; }

.catch-field-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.catch-color-palette { display: flex; gap: 6px; align-items: center; padding: 4px; }
.catch-color-dot { width: 22px; height: 22px; padding: 0; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #ccc; cursor: pointer; flex: 0 0 22px; }
.catch-color-dot[aria-pressed="true"] { box-shadow: 0 0 0 2px #333; }
.catch-color-dot:focus-visible, .catch-bold-toggle:focus-visible { outline: 2px solid #0000ff; outline-offset: 4px; }
.catch-bold-toggle { min-width: 48px; min-height: 30px; padding: 4px 8px; border: 1px solid #bbb; border-radius: 5px; background: #fff; color: #333; cursor: pointer; font: inherit; font-size: 13px; }
.catch-bold-toggle[aria-pressed="true"] { background: #333; color: #fff; font-weight: 700; }
