/*
Theme Name: Birds Are For Watching
Theme URI: https://birdsareforwatching.org/
Author: Birds Are For Watching
Description: Modern responsive two-column blog theme (content + sidebar) for Birds Are For Watching. Keeps the original sky-blue / yellow / green palette and logo.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: birds
*/

:root {
  --c-primary: #10bce7;
  --c-primary-dark: #0a8fb3;
  --c-accent: #eee167;
  --c-green: #3b7c0a;
  --c-green-dark: #2c5e07;
  --c-bg: #f0ecea;
  --c-surface: #ffffff;
  --c-text: #1d2a2f;
  --c-muted: #5d6b70;
  --c-border: #e1dbd8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(16,60,80,.07);
  --shadow-hover: 0 2px 4px rgba(0,0,0,.06), 0 14px 32px rgba(16,60,80,.14);
  --wrap: 1200px;
  --sidebar: 320px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Poppins", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--c-bg); color: var(--c-text);
  font: 400 17px/1.7 var(--font); -webkit-font-smoothing: antialiased;
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--c-primary-dark); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--c-green); }
h1,h2,h3,h4,h5,h6 { font-family: var(--font-head); line-height: 1.25; margin: 1.6em 0 .6em; color: #10242b; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin-top: 0; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.2em; }
:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; border-radius: 4px; }
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: fixed; left: 12px; top: 12px; z-index: 1000; background: #fff; padding: 10px 16px; clip: auto; width: auto; height: auto; border-radius: 8px; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

/* ---------- Header ---------- */
.topbar { background: var(--c-green); color: #fff; font-size: .85rem; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
.topbar a { color: #fff; text-decoration: none; }
.site-header { background: var(--c-surface); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 var(--c-border), 0 4px 16px rgba(0,0,0,.04); border-bottom: 3px solid var(--c-primary); }
.admin-bar .site-header { top: 32px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; }
.site-branding img, .custom-logo { display: block; width: auto; max-height: 56px; }
.site-title { font: 700 1.4rem var(--font-head); color: var(--c-text); text-decoration: none; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: 10px 14px; border-radius: 999px; color: var(--c-text); font: 600 .95rem var(--font-head); text-decoration: none; transition: background .2s, color .2s; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a { background: var(--c-primary); color: #fff; }
.main-nav .sub-menu { display: none; position: absolute; left: 0; top: 100%; min-width: 220px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-hover); padding: 8px; flex-direction: column; align-items: stretch; z-index: 20; }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { display: flex; }
.header-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--c-bg); color: var(--c-text); cursor: pointer; display: inline-grid; place-items: center; transition: background .2s; }
.icon-btn:hover { background: var(--c-accent); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav-toggle { display: none; }
.header-search { display: none; background: var(--c-surface); border-top: 1px solid var(--c-border); padding: 14px 0; }
.header-search.is-open { display: block; }

/* ---------- Forms ---------- */
.search-form { display: flex; gap: 8px; width: 100%; }
.search-form input[type=search], .comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea {
  flex: 1; width: 100%; padding: 12px 16px; border: 1px solid var(--c-border); border-radius: 999px; font: inherit; background: #fff; color: inherit;
}
.comment-form textarea { border-radius: var(--radius); }
.btn, .search-form button, .comment-form .submit, .wp-block-button__link {
  display: inline-block; padding: 12px 24px; border: 0; border-radius: 999px; background: var(--c-primary); color: #fff; font: 600 .95rem var(--font-head); text-decoration: none; cursor: pointer; transition: transform .15s, background .2s;
}
.btn:hover, .search-form button:hover, .comment-form .submit:hover { background: var(--c-green); color: #fff; transform: translateY(-1px); }
.btn--accent { background: var(--c-accent); color: #2b2a05; }
.btn--accent:hover { background: #fff; color: var(--c-green); }

/* ---------- Layout: two columns ---------- */
.site-main-wrap { padding: 36px 0 64px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--sidebar); gap: 40px; align-items: start; }
.layout > * { min-width: 0; }
.sidebar { position: sticky; top: 108px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.sidebar > * { min-width: 0; }
.widget { overflow-wrap: anywhere; }
.widget h2, .widget .wp-block-heading { font-size: 1.05rem; margin: 0 0 14px; }
.wp-block-search__inside-wrapper { display: flex; gap: 8px; flex-wrap: wrap; }
.wp-block-search__input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--c-border); border-radius: 999px; }
.admin-bar .sidebar { top: 140px; }

/* ---------- Hero ---------- */
.hero { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 36px; min-height: 380px; display: flex; align-items: flex-end; background: linear-gradient(135deg, var(--c-primary), var(--c-green)); box-shadow: var(--shadow); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,20,30,0) 25%, rgba(0,20,30,.82)); }
.hero-body { position: relative; z-index: 1; padding: clamp(20px, 4vw, 40px); color: #fff; max-width: 760px; }
.hero-body h2 { color: #fff; margin: 10px 0; font-size: clamp(1.6rem, 3.6vw, 2.5rem); }
.hero-body h2 a { color: inherit; text-decoration: none; }
.hero-body p { margin-bottom: 18px; opacity: .92; }

.badge { display: inline-block; background: var(--c-accent); color: #2b2a05; font: 700 .72rem var(--font-head); letter-spacing: .06em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; text-decoration: none; }
a.badge:hover { background: var(--c-primary); color: #fff; }

.section-title { display: flex; align-items: center; gap: 12px; font-size: 1.35rem; margin: 0 0 20px; }
.section-title::before { content: ""; width: 6px; height: 1.2em; border-radius: 3px; background: var(--c-primary); }
.section-title::after { content: ""; flex: 1; height: 2px; background: var(--c-border); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.card { background: var(--c-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card-thumb { display: block; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #d6f3fb, #f6f1b0); overflow: hidden; position: relative; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-thumb img { transform: scale(1.05); }
.card-thumb .badge { position: absolute; left: 14px; top: 14px; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 1.2rem; margin: 0 0 8px; }
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--c-primary-dark); }
.card-excerpt { color: var(--c-muted); font-size: .96rem; margin-bottom: 16px; }
.card-more { margin-top: auto; font: 600 .92rem var(--font-head); text-decoration: none; color: var(--c-green); }
.card-more::after { content: " →"; transition: margin .2s; }
.card-more:hover::after { margin-left: 4px; }
.meta { font-size: .85rem; color: var(--c-muted); display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; }

/* ---------- Single / page ---------- */
.entry { background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 44px); }
.entry-header { margin-bottom: 24px; }
.entry-thumb { margin: calc(clamp(20px, 4vw, 44px) * -1) calc(clamp(20px, 4vw, 44px) * -1) 28px; }
.entry-thumb img { width: 100%; display: block; }
.entry-content > * { max-width: 100%; }
.entry-content img { border-radius: 10px; }
.entry-content blockquote { margin: 1.6em 0; padding: 16px 24px; border-left: 5px solid var(--c-accent); background: #fbfaf0; border-radius: 0 10px 10px 0; font-style: italic; }
.entry-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--c-border); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--c-bg); }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: .4em; }
.entry-content pre { overflow-x: auto; background: #10242b; color: #e8f6fb; padding: 16px; border-radius: 10px; }
.alignleft { float: left; margin: 0 1.5em 1em 0; } .alignright { float: right; margin: 0 0 1em 1.5em; } .aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--c-muted); text-align: center; }
.tags a { display: inline-block; margin: 0 6px 6px 0; padding: 4px 14px; border-radius: 999px; background: var(--c-bg); font-size: .85rem; text-decoration: none; }
.tags a:hover { background: var(--c-accent); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.post-nav a { display: block; padding: 16px 20px; background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; font-weight: 600; color: var(--c-text); }
.post-nav a:hover { box-shadow: var(--shadow-hover); color: var(--c-primary-dark); }
.post-nav .next { text-align: right; }
.post-nav small { display: block; color: var(--c-muted); font-weight: 400; }
.related { margin-top: 40px; }
.related .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.archive-header { margin-bottom: 28px; padding: 28px; border-radius: var(--radius); background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark)); color: #fff; }
.archive-header h1 { color: #fff; margin-bottom: 8px; }
.archive-header p { margin: 0; opacity: .92; }

.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers { min-width: 44px; height: 44px; padding: 0 14px; display: grid; place-items: center; border-radius: 999px; background: var(--c-surface); box-shadow: var(--shadow); text-decoration: none; font-weight: 600; color: var(--c-text); }
.pagination .page-numbers.current, .pagination .page-numbers:hover { background: var(--c-primary); color: #fff; }

.breadcrumbs { font-size: .85rem; color: var(--c-muted); margin-bottom: 14px; }
.breadcrumbs a { color: inherit; }

/* ---------- Sidebar / widgets ---------- */
.widget { background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.widget-title { font-size: 1.05rem; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 3px solid var(--c-accent); display: inline-block; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--c-border); font-size: .96rem; }
.widget li:last-child { border: 0; }
.widget a { text-decoration: none; color: var(--c-text); }
.widget a:hover { color: var(--c-primary-dark); }
.widget--about { background: linear-gradient(160deg, #e3f7fd, #fbf7c9); text-align: center; }
.widget--about img { max-width: 180px; margin: 0 auto 12px; display: block; }
.recent-item { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; }
.recent-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.recent-item .ph { width: 72px; height: 72px; border-radius: 10px; background: linear-gradient(135deg, #d6f3fb, #f6f1b0); }
.recent-item strong { font: 600 .92rem/1.35 var(--font-head); display: block; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 28px; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--c-border); }
.comment-list .children { list-style: none; padding-left: 24px; }

/* ---------- Footer ---------- */
.site-footer { background: #10242b; color: #cfe0e6; margin-top: 0; border-top: 6px solid var(--c-accent); }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 48px 0 32px; }
.site-footer h3, .site-footer .widget-title { color: #fff; font-size: 1.05rem; margin-top: 0; border-color: var(--c-primary); }
.site-footer a { color: #cfe0e6; text-decoration: none; }
.site-footer a:hover { color: var(--c-accent); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 5px 0; }
.site-footer .widget { background: none; box-shadow: none; padding: 0; }
.site-footer .widget li { border: 0; }
.footer-logo { background: #fff; display: inline-block; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.footer-logo img { display: block; max-height: 44px; width: auto; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; font-size: .88rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.back-top { position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--c-green); color: #fff; font-size: 1.3rem; cursor: pointer; box-shadow: var(--shadow-hover); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.back-top.is-visible { opacity: 1; pointer-events: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .nav-toggle { display: inline-grid; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; padding: 12px 16px 20px; box-shadow: 0 12px 24px rgba(0,0,0,.12); max-height: calc(100vh - 90px); overflow-y: auto; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; }
  .main-nav .sub-menu { display: flex; position: static; box-shadow: none; padding: 0 0 0 16px; }
}
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 640px) {
  body { font-size: 16px; }
  .cards, .related .cards, .sidebar, .footer-cols, .post-nav { grid-template-columns: 1fr; }
  .hero { min-height: 300px; }
  .topbar .wrap { justify-content: center; }
  .topbar .tagline { display: none; }
  .alignleft, .alignright { float: none; display: block; margin: 0 auto 1em; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Archive page layout */
.header-inner{flex-wrap:wrap;padding-block:12px}.main-nav ul{flex-wrap:wrap}.main-nav a{font-size:.85rem;padding:8px 10px}.archive-text div:empty{display:none}.archive-text table{display:block;overflow-x:auto}.archive-text img{max-width:100%;height:auto}.archive-text .alignleft{float:left;margin:0 20px 12px 0}.archive-text .alignright{float:right;margin:0 0 12px 20px}.entry-content:after{content:"";display:block;clear:both}.archive-links{list-style:none;padding:0}.archive-links li{margin:.65em 0}.archive-text [usemap]{pointer-events:none}@media(max-width:980px){.main-nav{display:block!important;width:100%}.main-nav ul{display:flex!important;position:static}.header-inner{gap:12px}.archive-text .alignleft,.archive-text .alignright{float:none;margin:1em 0}}
