/*
Theme Name: Coastgrid
Author: Halden Type Co.
Description: Dense content theme. Category chip bar, horizontal post list and a persistent sidebar. Built for ilbucobyronbay.com as a self-contained replacement for a theme whose framework was lost.
Version: 2.0.9
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: coastgrid
Tags: blog, news, two-columns, custom-logo, featured-images
*/

/* ==========================================================================
   Tokens — cyan and type lifted from the site's own 2019 archived design
   ========================================================================== */
:root{
  --accent:#19b6bd;          /* archived #39d6dd, darkened for text contrast */
  --accent-bright:#39d6dd;   /* original, used for fills only */
  --accent-deep:#0e8288;
  --accent-wash:#eafafb;
  --ink:#1b2426;
  --muted:#667275;
  --bg:#f7f9f9;
  --surface:#ffffff;
  --line:#e0e7e8;
  --footer:#15201f;

  --f-head:'Montserrat',system-ui,-apple-system,'Segoe UI',Arial,sans-serif;
  --f-body:'Open Sans',system-ui,Arial,sans-serif;

  --maxw:1200px;
  --gutter:20px;
  --radius:5px;
}

*,*::before,*::after{box-sizing:border-box}

body{
  margin:0;background:var(--bg);color:var(--ink);
  font-family:var(--f-body);font-size:16px;line-height:1.64;
  -webkit-font-smoothing:antialiased;
}

h1,h2,h3,h4{font-family:var(--f-head);font-weight:700;line-height:1.22;margin:0 0 .45em;letter-spacing:-.01em}
h1{font-size:clamp(1.7rem,3.4vw,2.5rem)}
h2{font-size:clamp(1.3rem,2.3vw,1.8rem)}
h3{font-size:1.1rem}

a{color:var(--accent-deep);text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;height:auto;display:block}

.boundary{max-width:var(--maxw);margin:0 auto;padding:0 var(--gutter)}
.screen-reader-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap}
.skip-link{position:absolute;left:-9999px}
.skip-link:focus{left:8px;top:8px;background:#fff;padding:10px 16px;z-index:999;border:2px solid var(--accent)}

/* ==========================================================================
   Header — slim bar, logo left, nav right, then a category chip strip.
   The chip strip is Coastgrid's signature and keeps it distinct from the other
   themes in this network.
   ========================================================================== */
.site-top{background:var(--surface);border-bottom:1px solid var(--line)}
.masthead-inner{display:flex;align-items:center;justify-content:space-between;gap:26px;min-height:70px}

.logo-area{display:flex;align-items:center;gap:12px;text-decoration:none;flex:0 0 auto}
.logo-area img{max-height:48px;width:auto}
.wordmark .name{font-family:var(--f-head);font-size:1.3rem;font-weight:700;color:var(--ink);display:block;line-height:1.15}
.wordmark .strapline{font-size:.7rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}

.menu-btn{display:none;background:none;border:1px solid var(--line);border-radius:var(--radius);padding:8px 12px;font-size:1rem;cursor:pointer}

.menu-main ul{list-style:none;display:flex;align-items:center;gap:22px;margin:0;padding:0;flex-wrap:wrap;justify-content:flex-end}
.menu-main li{flex:0 0 auto}
.menu-main a{
  display:block;white-space:nowrap;color:var(--ink);
  font-family:var(--f-head);font-size:.85rem;font-weight:600;padding:7px 0;
}
.menu-main a:hover,.menu-main .current-menu-item > a{color:var(--accent-deep);text-decoration:none}

/* Category chips */
.quick-nav{background:var(--surface);border-bottom:2px solid var(--accent-bright);overflow-x:auto;scrollbar-width:none}
.quick-nav::-webkit-scrollbar{display:none}
.topic-strip-inner{display:flex;gap:8px;padding:10px 0;white-space:nowrap}
.cat-pill{
  flex:0 0 auto;display:inline-block;background:var(--accent-wash);color:var(--accent-deep);
  font-family:var(--f-head);font-size:.76rem;font-weight:600;letter-spacing:.04em;
  padding:6px 13px;border-radius:999px;border:1px solid transparent;
}
.cat-pill:hover,.cat-pill.current{background:var(--accent-bright);color:#04302f;text-decoration:none}
.cat-pill .n{opacity:.65;font-weight:500;margin-left:5px}

/* ==========================================================================
   Layout — content left, persistent sidebar right
   ========================================================================== */
.columns{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:32px;padding:26px 0 40px}

.section-head{margin-bottom:18px;padding-bottom:12px;border-bottom:2px solid var(--ink)}
.section-head h1{margin:0;font-size:clamp(1.3rem,2.2vw,1.7rem)}
.section-head .subtitle{color:var(--muted);font-size:.88rem;margin-top:5px}

/* ==========================================================================
   Post list — horizontal rows, not a card grid
   ========================================================================== */
.feed-item{
  display:grid;grid-template-columns:1fr 230px;gap:18px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  padding:14px;margin-bottom:14px;transition:box-shadow .2s;
}
.feed-item:hover{box-shadow:0 6px 20px rgba(27,36,38,.07)}
.feed-item .thumbnail{overflow:hidden;border-radius:4px;background:var(--accent-wash);aspect-ratio:16/10}
.feed-item .thumbnail img{width:100%;height:100%;object-fit:cover;transition:transform .35s}
.feed-item:hover .thumbnail img{transform:scale(1.04)}
.feed-item .kicker{
  font-family:var(--f-head);font-size:.7rem;font-weight:700;letter-spacing:.1em;
  text-transform:uppercase;color:var(--accent-deep);
}
.feed-item h2{font-size:1.14rem;margin:6px 0 7px;line-height:1.3}
.feed-item h2 a{color:var(--ink)}
.feed-item h2 a:hover{color:var(--accent-deep);text-decoration:none}
.feed-item .blurb{color:var(--muted);font-size:.9rem;margin-bottom:8px}
.feed-item .details{font-size:.76rem;color:var(--muted)}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.aside-col .widget{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px;margin-bottom:16px}
.aside-col .widget-title{
  font-family:var(--f-head);font-size:.78rem;font-weight:700;letter-spacing:.11em;
  text-transform:uppercase;color:var(--ink);margin:0 0 12px;
  padding-bottom:8px;border-bottom:2px solid var(--accent-bright);
}
.aside-col ul{list-style:none;margin:0;padding:0}
.aside-col li{padding:7px 0;border-bottom:1px solid var(--line);font-size:.9rem}
.aside-col li:last-child{border-bottom:0}
.aside-col li a{color:var(--ink)}
.aside-col li a:hover{color:var(--accent-deep)}

.side-post{display:flex;gap:10px;align-items:flex-start;padding:9px 0;border-bottom:1px solid var(--line)}
.side-post:last-child{border-bottom:0}
.side-post img{width:58px;height:44px;object-fit:cover;border-radius:3px;flex:0 0 auto}
.side-post a{color:var(--ink);font-size:.86rem;line-height:1.35;font-weight:600}
.side-post a:hover{color:var(--accent-deep)}
.side-post .timestamp{display:block;font-size:.72rem;color:var(--muted);margin-top:3px;font-weight:400}

/* ==========================================================================
   Entry
   ========================================================================== */
.post-view{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:26px}
.post-header{margin-bottom:18px}
.post-header .kicker{font-family:var(--f-head);font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--accent-deep)}
.post-header h1{margin:8px 0 10px}
.entry-info{color:var(--muted);font-size:.84rem}
.post-cover{margin:0 0 20px}
.post-cover img{width:100%;border-radius:4px}
.entry-content p{margin:0 0 1.35em}
.entry-content h2,.entry-content h3{margin-top:1.6em}
.entry-content img{border-radius:4px;margin:1.4em 0}
.entry-content ul,.entry-content ol{margin:0 0 1.35em;padding-left:1.3em}
.entry-content blockquote{margin:1.6em 0;padding:12px 18px;background:var(--accent-wash);border-left:4px solid var(--accent-bright);font-size:1.02rem}
.entry-content a{text-decoration:underline}
.entry-content table{width:100%;border-collapse:collapse;margin:1.4em 0}
.entry-content td,.entry-content th{border:1px solid var(--line);padding:8px}

/* Pagination */
.pagination{display:flex;gap:6px;justify-content:center;padding:24px 0;flex-wrap:wrap}
.pagination .page-numbers{
  padding:8px 14px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  color:var(--ink);font-family:var(--f-head);font-size:.85rem;font-weight:600;
}
.pagination .page-numbers:hover{border-color:var(--accent);text-decoration:none}
.pagination .current{background:var(--accent);border-color:var(--accent);color:#fff}

/* ==========================================================================
   Footer
   ========================================================================== */
.page-footer{background:var(--footer);color:rgba(255,255,255,.7);padding:34px 0 20px;margin-top:30px}
.footer-main{display:flex;justify-content:space-between;align-items:center;gap:20px;flex-wrap:wrap;padding-bottom:18px;border-bottom:1px solid rgba(255,255,255,.12)}
.page-footer .wordmark .name{color:#fff}
.page-footer a{color:rgba(255,255,255,.8)}
.page-footer a:hover{color:var(--accent-bright)}
.footer-menu ul{list-style:none;display:flex;gap:20px;margin:0;padding:0;flex-wrap:wrap}
.colophon-bar{padding-top:16px;font-size:.82rem;text-align:center}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media(max-width:1000px){
  .columns{grid-template-columns:1fr;gap:26px}
}
@media(max-width:680px){
  .menu-btn{display:block}
  .menu-main{display:none;width:100%}
  .menu-main.open{display:block}
  .masthead-inner{flex-wrap:wrap;padding:12px 0;min-height:0}
  .menu-main ul{flex-direction:column;gap:0;justify-content:flex-start;padding-top:10px}
  .menu-main li{width:100%;border-top:1px solid var(--line)}
  .menu-main a{padding:11px 0}
  .feed-item{grid-template-columns:1fr}
  .feed-item .thumbnail{order:-1}
  .footer-main{flex-direction:column;text-align:center}
}

/* PBN-HDRVAR-START */
/* Header arrangement — see the Customizer, "Header arrangement" */
body.hdrv-2 .site-top{display:flex;flex-direction:column}
body.hdrv-2 .quick-nav{order:-1;border-bottom:1px solid var(--line);background:var(--bg)}
body.hdrv-2 .topic-strip-inner{padding:7px 0}

body.hdrv-3 .masthead-inner{flex-direction:column;align-items:flex-start;gap:0;padding:16px 0 0;min-height:0}
body.hdrv-3 .logo-area{margin-bottom:14px}
body.hdrv-3 .menu-main{width:100%;border-top:1px solid var(--line)}
body.hdrv-3 .menu-main ul{justify-content:flex-start;gap:28px}
body.hdrv-3 .menu-main a{padding:12px 0;display:inline-block}

body.hdrv-4 .masthead-inner{flex-direction:column;align-items:center;gap:0;padding:20px 0 0;min-height:0}
body.hdrv-4 .logo-area{margin-bottom:16px}
body.hdrv-4 .menu-main{width:100%;border-top:1px solid var(--line)}
body.hdrv-4 .menu-main ul{justify-content:center;gap:30px}
body.hdrv-4 .menu-main a{padding:12px 0;display:inline-block}

body.hdrv-5 .site-top{display:flex;flex-direction:column}
body.hdrv-5 .quick-nav{order:-1;border-bottom:1px solid var(--line);background:var(--accent-wash)}
body.hdrv-5 .masthead-inner{flex-direction:column;align-items:center;gap:0;padding:20px 0 0;min-height:0}
body.hdrv-5 .logo-area{margin-bottom:16px}
body.hdrv-5 .menu-main{width:100%;border-top:1px solid var(--line)}
body.hdrv-5 .menu-main ul{justify-content:center;gap:30px}
body.hdrv-5 .menu-main a{padding:12px 0;display:inline-block}

body.hdrv-6 .masthead-inner{flex-direction:row-reverse}
body.hdrv-6 .menu-main ul{justify-content:flex-start}

body.hdrv-7 .site-top{display:flex;flex-direction:column}
body.hdrv-7 .quick-nav{order:-1;border-bottom:1px solid var(--line);background:var(--bg)}
body.hdrv-7 .masthead-inner{flex-direction:column;align-items:stretch;gap:0;padding:18px 0 14px;min-height:0}
body.hdrv-7 .logo-area{align-self:flex-start;margin-bottom:14px}
body.hdrv-7 .menu-main{background:var(--ink);border-radius:var(--radius)}
body.hdrv-7 .menu-main ul{justify-content:center;gap:0;padding:0 10px}
body.hdrv-7 .menu-main a{color:var(--surface);padding:12px 16px;display:inline-block}
body.hdrv-7 .menu-main a:hover,
body.hdrv-7 .menu-main .current-menu-item > a{background:rgba(255,255,255,.16);color:var(--surface)}

body.hdrv-8 .masthead-inner{flex-direction:column;align-items:stretch;gap:0;padding:16px 0 0;min-height:0}
body.hdrv-8 .logo-area{align-self:flex-start;margin-bottom:14px}
body.hdrv-8 .menu-main{border-top:1px solid var(--line)}
body.hdrv-8 .menu-main ul{justify-content:flex-end;gap:28px}
body.hdrv-8 .menu-main a{padding:12px 0;display:inline-block}

body.hdrv-9 .site-top{display:flex;flex-direction:column}
body.hdrv-9 .quick-nav{order:-1;border-bottom:1px solid var(--line);background:var(--surface)}
body.hdrv-9 .masthead-inner{flex-direction:column;align-items:center;gap:0;padding:26px 0 0;min-height:0}
body.hdrv-9 .logo-area{margin-bottom:20px}
body.hdrv-9 .logo-area img{max-height:64px}
body.hdrv-9 .menu-main{width:100%;border-top:3px solid var(--accent)}
body.hdrv-9 .menu-main ul{justify-content:center;gap:34px}
body.hdrv-9 .menu-main a{padding:13px 0;text-transform:uppercase;letter-spacing:.14em;font-size:.76rem;display:inline-block}

body.hdrv-10 .site-top{display:flex;flex-direction:column}
body.hdrv-10 .quick-nav{order:-1;border-bottom:1px solid var(--line);background:var(--bg)}
body.hdrv-10 .masthead-inner{flex-direction:row-reverse;min-height:78px}
body.hdrv-10 .menu-main ul{justify-content:flex-start;gap:8px}
body.hdrv-10 .menu-main a{padding:7px 14px;border:1px solid var(--line);border-radius:999px}
body.hdrv-10 .menu-main a:hover,
body.hdrv-10 .menu-main .current-menu-item > a{background:var(--accent-wash);border-color:var(--accent)}

/* Variants above turn .site-top into a flex column so the chip strip can
   move on top. .masthead-inner is a .boundary, and a .boundary has margin:0 auto — auto
   cross-axis margins make a flex item shrink-to-fit instead of filling, which
   collapses the header to the width of its own text. Put the width back. */
body.hdrv-2 .site-top > .boundary,
body.hdrv-5 .site-top > .boundary,
body.hdrv-7 .site-top > .boundary,
body.hdrv-9 .site-top > .boundary,
body.hdrv-10 .site-top > .boundary{width:100%}

@media(max-width:680px){
  body[class*="hdrv-"] .masthead-inner{flex-direction:row;flex-wrap:wrap;align-items:center;padding:12px 0;min-height:0}
  body[class*="hdrv-"] .logo-area{align-self:auto;margin-bottom:0}
  body[class*="hdrv-"] .logo-area img{max-height:48px}
  body[class*="hdrv-"] .menu-main{width:100%;border-top:0;background:none;border-radius:0}
  body[class*="hdrv-"] .menu-main ul{flex-direction:column;justify-content:flex-start;gap:0;padding:0}
  body[class*="hdrv-"] .menu-main a{padding:11px 0;border:0;border-radius:0;color:inherit;text-transform:none;letter-spacing:normal;font-size:inherit;display:block}
}
/* PBN-HDRVAR-END */

/* PBN-LAYOUT-START */
/* --- Sidebar position ----------------------------------------------------
   sb-left also moves the sidebar first in the markup; this puts the narrow
   track first so it lands in the correct column. sb-below collapses the grid
   to one column, which drops the sidebar underneath, and spreads its widgets
   across a band so it does not become a long stack. */
body.sb-left .content-layout,
body.sb-left .columns{grid-template-columns:300px minmax(0,1fr)}

body.sb-below .content-layout,
body.sb-below .columns{grid-template-columns:minmax(0,1fr)}
body.sb-below .aside-col{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:26px;
  align-items:start;margin-top:34px;padding-top:30px;border-top:1px solid var(--line);
}
body.sb-below .aside-col .widget{margin-bottom:0}

/* --- Footer arrangements ------------------------------------------------- */
.footer-list{text-align:center;padding-bottom:18px;border-bottom:1px solid rgba(255,255,255,.12)}
.footer-list .wordmark{display:block;margin-bottom:14px}
.footer-list .footer-menu ul{justify-content:center}

.footer-row{
  display:grid;gap:30px;padding-bottom:24px;
  border-bottom:1px solid rgba(255,255,255,.12);align-items:start;
}
.footer-row.c2{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr)}
.footer-row.c3{grid-template-columns:repeat(3,minmax(0,1fr))}
.footer-row.c4{grid-template-columns:repeat(4,minmax(0,1fr))}
.footer-row .footer-menu ul{flex-direction:column;gap:7px;align-items:flex-start}

.footer-aside{padding:16px 0;border-bottom:1px solid rgba(255,255,255,.12)}
.footer-aside .footer-menu ul{justify-content:center}
.footer-aside .footer-tags ul{display:flex;flex-wrap:wrap;gap:8px 18px}
.footer-aside .footer-tags .footer-heading{display:none}

.footer-heading{
  font-size:.74rem;letter-spacing:.14em;text-transform:uppercase;
  color:rgba(255,255,255,.55);margin:0 0 10px;font-weight:600;
}
.footer-tags ul,.footer-recent ul{list-style:none;margin:0;padding:0}
.footer-tags li,.footer-recent li{padding:4px 0}
.footer-tags a,.footer-recent a{color:rgba(255,255,255,.78);font-size:.88rem}
.footer-tags a:hover,.footer-recent a:hover{color:#fff;text-decoration:none}

@media(max-width:860px){
  body.sb-left .content-layout,
  body.sb-left .columns,
  body.sb-below .content-layout,
  body.sb-below .columns{grid-template-columns:minmax(0,1fr)}
  body.sb-below .aside-col{grid-template-columns:minmax(0,1fr);gap:0}
  body.sb-below .aside-col .widget{margin-bottom:22px}
  .footer-row.c2,.footer-row.c3,.footer-row.c4{grid-template-columns:minmax(0,1fr);gap:22px}
}
/* PBN-LAYOUT-END */

/* PBN-CARD-START */
/* Card markup varies per site. These keep the reordered versions looking
   intentional: .thumbnail may now be a <figure>, and variant 2 puts the image
   after the text, which flips which grid/flex slot it lands in. */
.feed-item figure.thumbnail{margin:0}
body.cardv-2 .feed-item{flex-direction:column-reverse}
body.cardv-2 .feed-item .text-col{padding-bottom:0}
/* PBN-CARD-END */

/* thumbnail fallbacks */
.feed-item:has(.thumbnail img[src$="placeholder.svg"]) .thumbnail{display:none}
.feed-item:has(.thumbnail img[src$="placeholder.svg"]){grid-template-columns:1fr}
.side-post img[src$="placeholder.svg"]{display:none}
