/* Inner pages: reuses the home palette and typography (see home.css). */

.page-section { padding-top: 40px; padding-bottom: 88px; }
.page-inner { display: flex; flex-direction: column; gap: 32px; }
.narrow { max-width: 760px; margin: 0 auto; width: 100%; }

.page-header { display: flex; flex-direction: column; gap: 14px; }
.page-title { font-size: clamp(40px, 5.4vw, 64px); line-height: 1; color: var(--ink); }
.page-subtitle { max-width: 620px; font-size: 18px; line-height: 1.6; color: #4D4460; }

.page-empty { text-align: center; padding: 56px 24px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.page-empty h2, .page-empty h3 { font-family: 'Fraunces', serif; font-weight: 700; font-size: 26px; color: var(--ink); }

/* Search */
.search-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.search-input { flex: 1 1 280px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-family: inherit; font-size: 15px; }
.search-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.search-results-info { color: var(--muted); font-size: 15px; }
.search-results-info strong { color: var(--ink); }

/* Article list */
.list-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
body.home .list-card { position: relative; display: flex; flex-direction: column; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; transition: transform .15s ease, border-color .15s ease; }
body.home .list-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.list-card-title { font-family: 'Fraunces', serif; font-weight: 700; font-size: 26px; line-height: 1.15; letter-spacing: -0.01em; flex: 1 1 auto; }
body.home .list-card-title a { color: var(--ink); text-decoration: none; }
body.home .list-card-title a::after { content: ""; position: absolute; inset: 0; border-radius: 20px; }
.list-card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; position: relative; z-index: 1; }
.list-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
body.home .list-card-footer .read-more { color: var(--primary); font-weight: 600; text-decoration: none; position: relative; z-index: 1; }
body.home .list-card-footer .read-more:hover { color: var(--ink); }
.list-card-reactions { display: flex; flex-wrap: wrap; gap: 8px; }
.list-card-reaction { display: inline-flex; gap: 4px; align-items: center; font-size: 13px; color: var(--muted); }
body.home .tag-link { position: relative; z-index: 1; }

/* Tags */
.tags-cloud { display: flex; flex-wrap: wrap; gap: 12px; }
body.home .tag--cloud { height: 46px; padding: 0 22px; font-size: 16px; border-radius: 12px; }

/* About */
.about-text { max-width: 760px; display: flex; flex-direction: column; gap: 18px; font-size: 18px; line-height: 1.7; color: #3E3550; }
.interest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.interest-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.interest-card h3 { font-family: 'Fraunces', serif; font-weight: 700; font-size: 22px; color: var(--ink); }
.interest-card p { font-size: 15px; line-height: 1.6; color: #4D4460; }

/* Article view */
.article-view { display: flex; flex-direction: column; gap: 40px; }
.article-header { display: flex; flex-direction: column; gap: 20px; }
.article-meta-header { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary); }
.article-view-title { font-size: clamp(36px, 5vw, 60px); line-height: 1.04; color: var(--ink); }
.article-tags { display: flex; flex-wrap: wrap; gap: 10px; }

.markdown-body { font-size: 18px; line-height: 1.8; color: #3E3550; overflow-wrap: anywhere; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 { font-family: 'Fraunces', serif; font-weight: 700; color: var(--ink); line-height: 1.2; margin: 2.5rem 0 1rem; letter-spacing: -0.01em; }
.markdown-body h2 { font-size: 2rem; }
.markdown-body h3 { font-size: 1.5rem; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body blockquote, .markdown-body table { margin-bottom: 1.5rem; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5rem; }
.markdown-body li { margin-bottom: .4rem; }
body.home .markdown-body a { color: var(--primary); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
body.home .markdown-body a:hover { color: var(--ink); }
.markdown-body blockquote { border-left: 4px solid var(--accent); padding: 4px 0 4px 20px; color: var(--muted); }
.markdown-body code { font-family: 'Consolas', 'Monaco', monospace; font-size: .9em; background: var(--line); padding: 2px 6px; border-radius: 6px; }
.markdown-body pre { background: var(--ink-deep); color: #E6E0F2; padding: 24px; border-radius: 16px; overflow-x: auto; margin: 2rem 0; }
.markdown-body pre code { background: none; padding: 0; color: inherit; }
.markdown-body table { border-collapse: collapse; width: 100%; font-size: 16px; }
.markdown-body th, .markdown-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.markdown-body th { background: var(--card); }
.markdown-body img { max-width: 100%; height: auto; display: block; border-radius: 12px; margin: 1.5rem auto; cursor: zoom-in; }
.markdown-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.article-footer-section { padding-top: 24px; border-top: 1px solid var(--line); }

/* Reactions */
.reactions-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.reaction-form { display: inline-flex; }
.reaction-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.reaction-btn:hover { border-color: var(--accent); transform: translateY(-2px); }
.reaction-emoji { font-size: 18px; line-height: 1; }
.reaction-count { font-size: 13px; color: var(--muted); }
.reaction-btn--reacted { border-color: var(--primary); opacity: .7; cursor: not-allowed; }

.reactions-bar-floating { position: fixed; top: 0; left: 50%; transform: translate(-50%, -100%); z-index: 900; opacity: 0; transition: transform .3s ease, opacity .3s ease; pointer-events: none; }
.reactions-bar-floating.is-visible { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.reactions-bar-floating__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 16px; background: var(--paper-light); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 32px rgba(42, 35, 53, .18); }
@media (max-width: 600px) {
  .reactions-bar-floating { width: max-content; max-width: calc(100vw - 16px); }
  .reactions-bar-floating__inner { justify-content: center; gap: 4px; padding: 6px 8px; border-radius: 12px; }
  .reactions-bar-floating .reaction-btn { height: 32px; gap: 4px; padding: 0 8px; border-radius: 8px; }
  .reactions-bar-floating .reaction-emoji { font-size: 16px; }
  .reactions-bar-floating .reaction-count { font-size: 12px; }
}

/* Comments */
.comments-section { display: flex; flex-direction: column; gap: 28px; padding-top: 40px; border-top: 1px solid var(--line); }
.comments-title { font-family: 'Fraunces', serif; font-weight: 900; font-size: 32px; color: var(--ink); }
.status-message { padding: 14px 18px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.status-message.success { border-color: var(--primary); color: var(--primary-dark); }
.comment-form-container { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.comment-form-title { font-family: 'Fraunces', serif; font-weight: 700; font-size: 22px; margin-bottom: 18px; color: var(--ink); }
.comment-form { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.form-input, .form-textarea { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper-light); color: var(--ink); font-family: inherit; font-size: 15px; }
.form-textarea { resize: vertical; min-height: 120px; }
.form-input:focus, .form-textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.text-danger { color: #B3261E; font-size: 13px; }
.btn-submit-comment { align-self: flex-start; min-height: 46px; padding: 0 22px; border: 0; border-radius: 12px; background: var(--primary); color: var(--paper-light); font-family: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
.btn-submit-comment:hover { background: var(--primary-dark); }
.comments-list { display: flex; flex-direction: column; gap: 16px; }
.comment-item { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.comment-header { display: flex; align-items: center; gap: 12px; }
.comment-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: var(--paper-light); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.comment-info { display: flex; flex-direction: column; }
.comment-author { font-weight: 600; color: var(--ink); }
.comment-date { font-size: 13px; color: var(--muted); }
.comment-content { white-space: pre-wrap; line-height: 1.6; color: #3E3550; overflow-wrap: anywhere; }
.no-comments { color: var(--muted); }

/* Image zoom modal */
.img-modal-backdrop { position: fixed; inset: 0; z-index: 2000; background: rgba(31, 24, 41, .9); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.img-modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.img-modal-img { max-width: min(90vw, 1400px); max-height: 90vh; border-radius: 12px; pointer-events: none; user-select: none; }
.img-modal-close { position: fixed; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .12); color: #fff; font-size: 20px; cursor: pointer; z-index: 2001; }

/* Active nav item and mobile spacing */
body.home .nav a[aria-current="page"] { border-bottom-color: var(--primary); }
