/* Nyack Wine Cellar - static rebuild */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  border-top: 3px solid #333;
  background: #999 url("/images/body-bg.webp") 50% 0 / cover fixed no-repeat;
  color: #444;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

img { display: block; max-width: 100%; height: auto; }
a { color: #77312f; }
a:hover, a:focus { color: #381615; }

h1, h2, h3, h4 { margin: 0; font-weight: 400; color: #666; }

/* Boxed layout like the original */
.site {
  max-width: 1000px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.16);
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  background: #ffeac4;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 18px 20px 14px;
}

.logo img { width: min(340px, 72vw); height: auto; }

.slogan { line-height: 1.5; }
.slogan a { display: block; color: #77312f; text-decoration: none; }
.slogan .call { font-size: 20px; font-weight: 700; }
.slogan .addr { font-size: 13px; }
.slogan a:hover, .slogan a:focus { text-decoration: underline; }

/* Mobile menu (CSS only) */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }

.nav-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: #77312f;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.bars { display: inline-flex; flex-direction: column; gap: 4px; width: 20px; }
.bars span { height: 2px; background: #fff; border-radius: 1px; }
.nav-toggle:focus-visible + .nav-button { outline: 2px solid #381615; outline-offset: -2px; }

.main-nav { display: none; background: #77312f; }
.nav-toggle:checked ~ .main-nav { display: block; }

.main-nav ul { margin: 0; padding: 0; list-style: none; }
.main-nav a {
  display: block;
  padding: 13px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  text-decoration: none;
}
.main-nav a:hover,
.main-nav a:focus,
.main-nav a[aria-current="page"] { background: #381615; color: #fff; font-weight: 600; }

/* ---------- Home slider (CSS only, 3 slides, 7s each) ---------- */
.slider {
  position: relative;
  aspect-ratio: 1000 / 400;
  overflow: hidden;
  background: #222;
}
.slide { position: absolute; inset: 0; opacity: 0; animation: slide-cycle 21s infinite; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-1 { animation-delay: -1s; }
.slide-2 { animation-delay: 6s; }
.slide-3 { animation-delay: 13s; }

@keyframes slide-cycle {
  0%      { opacity: 0; }
  4.76%   { opacity: 1; }   /* 1s fade in */
  33.33%  { opacity: 1; }
  38.1%   { opacity: 0; }   /* 1s fade out */
  100%    { opacity: 0; }
}

/* Slide 1: black and white glasses fade to color, then the banner fades in */
.slide-1 img { position: absolute; }
.slide-1 .s1-bw, .slide-1 .s1-color { inset: 0; }
.slide-1 .s1-color { opacity: 0; animation: s1-color 21s infinite; animation-delay: -1s; }
.slide-1 .s1-text {
  top: 22.5%;
  right: 0;
  width: 62%;
  height: auto;
  opacity: 0;
  animation: s1-text 21s infinite;
  animation-delay: -1s;
}

@keyframes s1-color {
  0%, 4.76% { opacity: 0; }
  11.9%     { opacity: 1; }
  38.1%     { opacity: 1; }
  100%      { opacity: 1; }
}
@keyframes s1-text {
  0%, 11.9% { opacity: 0; }
  19%       { opacity: 1; }
  100%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .slide, .slide-1 img { animation: none; }
  .slide-1, .slide-1 .s1-color, .slide-1 .s1-text { opacity: 1; }
}

/* ---------- Page layout ---------- */
.page-wrap { padding: 36px 20px 50px; }
.page-wrap.narrow { max-width: 700px; margin: 0 auto; }

.with-sidebar { display: grid; grid-template-columns: 1fr; gap: 40px; }

/* Section headings with the striped rule */
h3.title {
  margin: 0 0 20px;
  background: url("/images/stripes.webp") repeat-x 0 50%;
  color: #666;
  font-size: 18px;
  line-height: 18px;
}
h3.title span { padding-right: 8px; background: #fff; }

/* ---------- Home ---------- */
.home-grid { display: grid; grid-template-columns: 1fr; gap: 36px; }

.about-box {
  padding: 30px;
  background: #f8f8f8;
}
.about-box p { margin: 0 0 20px; }
.about-box p:last-child { margin-bottom: 0; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: linear-gradient(to top, #f7f7f7, #fff);
  box-shadow: 0 1px 1px rgba(180, 180, 180, 0.2);
  color: #77312f;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, .button:focus { border-color: #77312f; color: #381615; }
.button svg { width: 14px; height: 14px; }

.recent-item {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 20px;
  margin-bottom: 22px;
}
.recent-item h4 { font-size: 16px; line-height: 1.5; }
.recent-item h4 a { color: #666; text-decoration: none; }
.recent-item h4 a:hover, .recent-item h4 a:focus { color: #77312f; }
.recent-item p { margin: 2px 0 0; }

.date-box {
  align-self: start;
  padding-top: 10px;
  background: #f4f4f4;
  color: #666;
  font-size: 20px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.date-box span {
  display: block;
  margin-top: 10px;
  padding: 5px 0;
  background: #666;
  color: #fff;
  font-size: 11px;
  line-height: 11px;
  text-transform: uppercase;
}

/* ---------- Title bar (inner pages) ---------- */
.title-bar {
  padding: 22px 20px;
  border-bottom: 1px solid #eee;
  background: #f9f9f9;
}
.title-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 20px;
}
.title-bar h1 { color: #666; font-size: 22px; line-height: 1.4; }
.crumbs { margin: 0; color: #999; font-size: 12px; }
.crumbs a { color: #999; text-decoration: none; }
.crumbs a:hover, .crumbs a:focus { color: #77312f; }

/* ---------- Blog banner ---------- */
.blog-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 20px 34px;
  background: url("/images/blog-banner.webp") 50% 50% / cover no-repeat;
  box-shadow: inset 0 0 3px rgba(50, 50, 50, 0.12);
  text-align: center;
}
.banner-title {
  width: min(400px, 100%);
  margin: 0;
  padding: 14px 20px;
  background: #77312f;
  color: #fff;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
}
.banner-sub {
  width: min(350px, 100%);
  margin: 0;
  padding: 8px 20px;
  background: #fff;
  color: #999;
  font-size: 15px;
  line-height: 1.2;
}

/* ---------- Blog list ---------- */
.post-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 50px;
  padding-bottom: 50px;
  border-bottom: 1px solid #efefef;
}
.post-item:last-child { margin-bottom: 0; }
.post-thumb img { width: 100%; aspect-ratio: 320 / 210; object-fit: cover; }
.post-body h2 { margin-bottom: 12px; font-size: 22px; line-height: 1.5; }
.post-body h2 a { color: #666; text-decoration: none; }
.post-body h2 a:hover, .post-body h2 a:focus { color: #77312f; }
.post-body p { margin: 0; }
.read-more { white-space: nowrap; }

.post-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.post-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px 4px 10px;
  background: #f4f4f4;
  color: #999;
  font-size: 11px;
  line-height: 18px;
}
.post-meta svg { width: 12px; height: 12px; }

/* ---------- Single post ---------- */
.single h1 { margin: 0 0 16px; color: #666; font-size: 22px; line-height: 1.6; }
.single .post-meta { margin-bottom: 26px; }
.single .featured { width: 100%; aspect-ratio: 700 / 300; object-fit: cover; margin-bottom: 26px; }
.entry p { margin: 0 0 20px; }
.entry h4 { margin: 24px 0 10px; color: #555; font-size: 16px; font-weight: 700; }
.entry ul { margin: 0 0 20px; padding-left: 22px; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid #efefef;
  font-size: 13px;
}
.post-nav a { text-decoration: none; }
.post-nav a:hover, .post-nav a:focus { text-decoration: underline; }
.post-nav .next { text-align: right; }

/* ---------- Sidebar ---------- */
.sidebar { font-size: 13px; }
.widget { margin-bottom: 36px; }
.sidebar h3.title { font-size: 15px; font-weight: 700; line-height: 15px; }

.recent { margin: 0; padding: 0; list-style: none; }
.recent li {
  padding: 2px 0 2px 12px;
  background: url("/images/arrow.webp") no-repeat 0 10px;
  color: #888;
}
.recent a { text-decoration: none; }
.recent a:hover, .recent a:focus { text-decoration: underline; }

/* ---------- Contact details ---------- */
.contact-card p { margin: 0 0 16px; }
.contact-card strong { color: #555; }
.contact-card a { text-decoration: none; }
.contact-card a:hover, .contact-card a:focus { text-decoration: underline; }
.sidebar .contact-card { color: #666; }

/* ---------- Contact page ---------- */
.map { position: relative; aspect-ratio: 16 / 7; min-height: 260px; background: #eee; }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-link { margin: 6px 0 30px; }

.contact-grid { display: grid; grid-template-columns: 1fr; gap: 36px; }
.contact-info > p { margin: 0 0 22px; }
.storefront { width: 100%; }

/* ---------- Footer ---------- */
.copyright {
  padding: 8px 20px;
  background: #222;
  color: #777;
  font-size: 13px;
  text-align: center;
}
.copyright a { color: #888; text-decoration: none; }
.copyright a:hover, .copyright a:focus { color: #ccc; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}
.back-to-top:hover, .back-to-top:focus { background: #77312f; color: #fff; }
.back-to-top svg { width: 20px; height: 20px; }

/* ---------- Tablet and up ---------- */
@media (min-width: 768px) {
  body { font-size: 13px; line-height: 22.1px; }

  .header-inner { padding: 22px 23px 18px; }
  .slogan { text-align: right; }

  .nav-button { display: none; }
  .main-nav { display: block; }
  .main-nav ul { display: flex; flex-wrap: wrap; justify-content: center; }
  .main-nav a { padding: 14px 20px; border-top: 0; font-size: 13px; line-height: 13px; }

  .page-wrap { padding: 40px 23px 50px; }

  .home-grid,
  .contact-grid { grid-template-columns: 1fr 1fr; gap: 30px; }

  .with-sidebar { grid-template-columns: minmax(0, 1fr) 200px; gap: 30px; }

  .post-item { grid-template-columns: 320px 1fr; gap: 20px; }
  .post-item .post-meta { grid-column: 1 / -1; }
}

@media (min-width: 1000px) {
  .with-sidebar { grid-template-columns: minmax(0, 1fr) 240px; gap: 50px; }
}

/* No fixed background on touch devices (it is jumpy there) */
@media (hover: none) {
  body { background-attachment: scroll; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}