/*
Theme Name: 海愿 SeaWish
Description: 一本由海岸晨光、深蓝与暖白组成的个人兴趣志，支持 WordPress 区块编辑。
Version: 2.0.0
Requires at least: 6.6
Requires PHP: 7.4
Author: SeaWish
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nightfield
*/

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { text-underline-offset: .22em; }
::selection { background: #bce6df; color: #123d49; }
:focus-visible { outline: 2px solid #2b7d85; outline-offset: 5px; }
.wp-site-blocks { overflow: clip; }
.wp-block-heading { overflow-wrap: anywhere; }

.nf-header {
  color: #eef8f7;
  background: #102a37;
  border-bottom: 1px solid #ffffff23;
}
.nf-header-inner { min-height: 78px; }
.nf-brand { display: flex; align-items: center; gap: 12px; }
.nf-brand::before {
  content: "";
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid #c0e5dd92;
  border-radius: 50%;
  background:
    radial-gradient(circle at 64% 35%, #f1bd96 0 2.5px, transparent 3px),
    linear-gradient(166deg, transparent 52%, #c0e5dd 53% 56%, transparent 57%),
    linear-gradient(166deg, transparent 64%, #c0e5dd 65% 68%, transparent 69%);
}
.nf-brand .wp-block-site-title { margin: 0; line-height: 1.3; letter-spacing: .16em; }
.nf-brand a, .nf-nav a { color: inherit; text-decoration: none; }
.nf-nav { gap: clamp(16px, 3.1vw, 42px); font-size: .9375rem; }
.nf-nav a:hover, .nf-nav a[aria-current="page"] { color: #bce6df; }
.nf-header :focus-visible, .nf-hero :focus-visible { outline-color: #f1bd96; }
.nf-header .nf-nav.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) {
  background: #102a37;
  color: #eef8f7;
  padding: 32px 24px;
  --navigation-layout-justification-setting: flex-start;
}
.nf-header .nf-nav .is-menu-open .wp-block-navigation__responsive-container-content,
.nf-header .nf-nav .is-menu-open .wp-block-navigation__container { align-items: flex-start; width: 100%; }
.nf-header .nf-nav .is-menu-open .wp-block-navigation-item__content {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 0;
  font-size: 1.25rem;
}
.nf-header .nf-nav .wp-block-navigation__responsive-container-open,
.nf-header .nf-nav .wp-block-navigation__responsive-container-close { min-width: 44px; min-height: 44px; padding: 10px; }

.nf-hero {
  margin-top: 0 !important;
  background: #1a3b50;
  color: #fffdf5;
}
.nf-hero[style*="min-height:720px"] { min-height: clamp(520px, 76svh, 690px) !important; }
.nf-hero .wp-block-cover__image-background { object-position: 78% 53%; }
.nf-hero .wp-block-cover__background.has-background-background-color {
  background-color: #0d2636 !important;
  opacity: .09;
}
.nf-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #091f30cf 0%, #102a3d77 46%, #102a3d00 80%),
              linear-gradient(0deg, #0c25388c 0%, transparent 52%);
  pointer-events: none;
}
.nf-hero .wp-block-cover__inner-container { z-index: 2; }
.nf-hero .nf-hero-inner { padding-block: clamp(56px, 10vw, 116px); }
.nf-hero .nf-eyebrow { font-size: .875rem; font-weight: 650; letter-spacing: .18em; }
.nf-hero .nf-eyebrow.has-mint-color { color: #deeeea !important; }
.nf-hero h1 {
  color: inherit;
  font-family: var(--wp--preset--font-family--serif);
  font-size: clamp(3.5rem, 6.2vw, 6.1rem);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -.046em;
  margin: .2em 0 .32em;
}
.nf-hero h1 .has-mint-color { color: #c4ebe4 !important; }
.nf-hero .nf-hero-copy { max-width: 34rem; line-height: 1.85; }
.nf-hero .nf-hero-copy.has-foreground-color { color: #edf5f4 !important; }
.nf-hero .wp-block-buttons { margin-top: 28px; gap: 12px; }
.nf-hero .wp-block-button:not(.is-style-outline) > a {
  background: #c4ebe4;
  color: #123d49;
}
.nf-hero .wp-block-button.is-style-outline > a { color: #fffdf5 !important; }
.nf-hero .wp-block-button > a:hover { background-color: #ffffff26; color: #fffdf5; }
.nf-hero .wp-block-button.is-style-outline > a:hover { background-color: #ffffff26; }

.nf-section { padding-block: clamp(46px, 6vw, 80px); }
.nf-section-heading { margin-bottom: clamp(24px, 3vw, 38px); }
.nf-section-heading h2 { line-height: 1.3; letter-spacing: -.035em; }
.nf-section-heading p { margin-top: 10px; }
.nf-section[id] { scroll-margin-top: 24px; }
#interests { border-block: 1px solid var(--wp--preset--color--border); }

.nf-category-grid { gap: 18px; }
.nf-category-card {
  position: relative;
  min-width: 0;
  height: 100%;
  padding: 24px;
  background: var(--sea-card-color, #fdfcf8);
  border: 1px solid var(--wp--preset--color--border);
  border-top: 3px solid var(--sea-card-edge, #247986);
  border-radius: 2px 2px 12px 12px;
  transition: box-shadow .2s, transform .2s;
}
.nf-category-grid > :nth-child(1) { --sea-card-color: #f5fbfb; --sea-card-edge: #2c7682; }
.nf-category-grid > :nth-child(2) { --sea-card-color: #fffbf5; --sea-card-edge: #af7251; }
.nf-category-grid > :nth-child(3) { --sea-card-color: #f8fbf5; --sea-card-edge: #6c8463; }
.nf-category-grid > :nth-child(4) { --sea-card-color: #f7f8fc; --sea-card-edge: #667b9c; }
.nf-category-card:focus-within, .nf-category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px #13354412;
}
.nf-category-card h3 { margin: .6rem 0 .7rem; font-size: 1.4rem; }
.nf-category-card h3 a { text-decoration: none; }
.nf-category-card h3 a:hover { text-decoration: underline; }
.nf-category-card p { margin: .6rem 0 0; font-size: 1rem; line-height: 1.7; }
.nf-category-card .nf-category-tag { margin: 0; color: #42626c; font-size: .75rem; letter-spacing: .16em; font-weight: 700; }

.nf-post-grid .wp-block-post {
  min-width: 0;
  padding: clamp(20px, 3vw, 36px);
  background: #fffefa;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 12px;
}
.nf-post-grid .wp-block-post-template:has(> .wp-block-post:only-child) { grid-template-columns: 1fr; }
.nf-post-grid .wp-block-post-featured-image { overflow: hidden; border-radius: 7px; }
.nf-post-grid .wp-block-post-featured-image img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.nf-post-grid .wp-block-post-title { margin: 10px 0; font-size: clamp(1.3rem, 2.3vw, 1.8rem); line-height: 1.45; overflow-wrap: anywhere; }
.nf-post-grid .wp-block-post-title a { text-decoration: none; }
.nf-post-grid .wp-block-post-title a:hover { text-decoration: underline; }
.nf-post-grid .wp-block-post-excerpt { max-width: 49rem; color: var(--wp--preset--color--muted); line-height: 1.8; }
.nf-post-grid .wp-block-post-excerpt__more-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--wp--preset--color--mint); font-size: .9375rem; }
.nf-post-grid .wp-block-post-date { font-size: .8125rem; color: var(--wp--preset--color--muted); font-variant-numeric: tabular-nums; }
.nf-post-grid .wp-block-post-terms { font-size: .875rem; color: var(--wp--preset--color--mint); }

.nf-quiet-panel {
  padding: clamp(24px, 4.6vw, 54px);
  border-radius: 14px;
  background: linear-gradient(123deg, #123141, #215666);
  color: #eef8f7;
}
.nf-quiet-panel h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2.2rem); }
.nf-quiet-panel h2 .has-mint-color { color: #bce6df !important; }
.nf-quiet-panel p { margin-bottom: 0; line-height: 1.9; }
.nf-quiet-panel a { color: inherit; }
.nf-footer { border-top: 1px solid var(--wp--preset--color--border); padding-block: 32px; background: var(--wp--preset--color--surface); }
.nf-footer p { margin: 0; }
.nf-footer .wp-block-site-title { font-family: var(--wp--preset--font-family--serif); letter-spacing: .14em; }
.nf-footer a { text-decoration: none; }
.nf-footer a:hover { text-decoration: underline; }

.nf-reading { padding-block: clamp(44px, 7vw, 96px); }
.nf-reading .wp-block-post-title {
  margin-block: 16px;
  font-size: clamp(1.9rem, 4.4vw, 3.45rem);
  line-height: 1.36;
  letter-spacing: -.04em;
  overflow-wrap: anywhere;
}
.nf-reading .wp-block-post-content { margin-top: clamp(26px, 4vw, 49px); font-size: 1.0625rem; line-height: 1.95; overflow-wrap: anywhere; }
.nf-reading .wp-block-post-content h2 { font-size: clamp(1.5rem, 3.5vw, 1.875rem); margin-top: 1.6em; }
.nf-reading .wp-block-post-content h3 { font-size: 1.375rem; margin-top: 1.5em; }
.nf-reading .wp-block-post-content a, .wp-block-query-pagination a { color: var(--wp--preset--color--mint); }
.nf-reading .wp-block-post-content blockquote { border-inline-start: 3px solid var(--wp--preset--color--mint); margin-inline: 0; padding: 8px 20px; background: var(--wp--preset--color--surface); }
.nf-reading pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--wp--preset--color--surface); padding: 22px; border-radius: 8px; font-size: .875rem; }
.nf-reading .wp-block-post-featured-image { margin-top: 30px; border-radius: 12px; overflow: hidden; }
.nf-reading .wp-block-post-featured-image img { max-height: 600px; width: 100%; object-fit: cover; }
.nf-reading .wp-block-post-navigation-link { font-size: .9375rem; }
.wp-block-query-pagination { margin-top: 35px; gap: 20px; }
.nf-empty-state { border-top: 1px solid var(--wp--preset--color--border); padding-block: 28px 0; }
.wp-block-search__input, .post-password-form input {
  min-width: 0;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--wp--preset--color--border);
  border-radius: 8px;
  background: #fffefa;
  color: var(--wp--preset--color--foreground);
  font: inherit;
}
.wp-block-search__button { flex-shrink: 0; min-height: 44px; }
.post-password-form { padding: 24px; background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--border); border-radius: 8px; }
.post-password-form input[type=submit] { background: var(--wp--preset--color--mint); color: #fffdf5; cursor: pointer; }

@media (min-width: 782px) and (max-width: 1050px) {
  .nf-category-grid { flex-wrap: wrap !important; }
  .nf-category-grid > .wp-block-column { flex-basis: calc(50% - 12px) !important; flex-grow: 0; }
}
@media (max-width: 781px) {
  .nf-header-inner { min-height: 66px; }
  .nf-brand::before { width: 32px; height: 32px; }
  .nf-post-grid .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nf-post-grid .wp-block-post-template:has(> .wp-block-post:only-child) { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .nf-hero[style*="min-height:720px"] { min-height: clamp(460px, 72svh, 610px) !important; }
  .nf-hero .wp-block-cover__image-background { object-position: 84% 50%; }
  .nf-hero::after {
    background: linear-gradient(90deg, #102a3da8, #102a3d28),
                linear-gradient(0deg, #091f30c2, #102a3d75 52%, #102a3d20 100%);
  }
  .nf-hero h1 { font-size: clamp(2.4rem, 10vw, 4rem); }
  .nf-hero .nf-eyebrow { font-size: .75rem; }
  .nf-post-grid .wp-block-post-template.is-layout-grid { grid-template-columns: 1fr; }
  .nf-reading .wp-block-post-content { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
