:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #000000;
  --muted: #4b5563;
  --stroke: rgba(17, 24, 39, 0.12);
  --stroke-strong: rgba(17, 24, 39, 0.22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: #1d4ed8; }

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--stroke);
  background-color: var(--bg);
  background-image: linear-gradient(180deg, rgba(17,24,39,0.03), rgba(17,24,39,0));
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.header-images {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-images img {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--stroke);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo {
  display: block;
  width: 192px;
  height: auto;
  max-height: 192px;
  margin: 0;
  padding: 0;
  object-fit: contain;
  flex: 0 0 auto;
}

@media (max-width: 520px) {
  .brand-logo {
    width: 160px;
    height: auto;
    max-height: 160px;
  }

  .header-images img {
    width: 56px;
    height: 56px;
  }
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: 0.2px;
}

.brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav > a,
.nav > .nav-item > a {
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav > a[aria-current="page"],
.nav > .nav-item > a[aria-current="page"] {
  background: maroon;
  color: #fff;
  border-color: transparent;
}

.nav > a:hover,
.nav > .nav-item > a:hover {
  border-color: var(--stroke);
  background: rgba(17,24,39,0.03);
}

.nav > a[aria-current="page"]:hover,
.nav > .nav-item > a[aria-current="page"]:hover {
  background: maroon;
  color: #fff;
  border-color: transparent;
}

.nav-item {
  position: relative;
  display: inline-flex;
}

.nav-flyout {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  min-width: 260px;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--panel);
  display: none;
}

.nav-item--has-flyout:hover .nav-flyout,
.nav-item--has-flyout:focus-within .nav-flyout {
  display: block;
}

.nav-flyout-section + .nav-flyout-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--stroke);
}

.nav-flyout-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.nav-flyout-links {
  display: grid;
  gap: 6px;
}

.nav-flyout-link {
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.nav-flyout-link:hover {
  border-color: var(--stroke);
  background: rgba(17,24,39,0.03);
}

.nav-flyout-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 6px 8px;
}

.home-ourname {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 14px auto;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden;
}

.card-body {
  padding: 14px 14px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.card p {
  margin: 0 0 10px;
  color: var(--ink);
  line-height: 1.5;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.home-main {
  display: grid;
  gap: 14px;
}

@media (max-width: 860px) {
  .home-layout {
    grid-template-columns: 1fr;
  }
}

.home-side {
  display: grid;
  gap: 14px;
}

.home-carousel {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(17,24,39,0.02);
}

.home-carousel img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.home-carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
}

.home-random-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 980px) {
  .home-random-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .home-random-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .home-random-grid {
    grid-template-columns: 1fr;
  }
}

.home-dog-tile {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(17,24,39,0.02);
}

.home-dog-tile img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.home-dog-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 13px;
  line-height: 1.25;
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.contact-main {
  max-width: 620px;
  width: 100%;
  justify-self: start;
}

.contact-form {
  max-width: 560px;
}

@media (max-width: 860px) {
  .about-layout {
    grid-template-columns: 1fr;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-main {
    max-width: none;
  }
}

.about-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.about-gallery-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(17,24,39,0.02);
}

.home-latest-news {
  display: grid;
  gap: 10px;
}

.home-news-item {
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(17,24,39,0.02);
}

.home-news-headline {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  color: inherit;
  text-decoration: none;
  display: inline-block;
}

.home-news-headline:hover {
  text-decoration: underline;
}

.home-news-date {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.news-list {
  display: grid;
  gap: 14px;
}

.news-item {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(17,24,39,0.02);
  padding: 14px 14px;
}

.news-item.news-item--target {
  border-color: var(--stroke-strong);
  background: rgba(17,24,39,0.04);
}

.news-headline {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.2px;
  color: var(--ink);
}

.news-meta {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.news-article {
  white-space: pre-line;
  line-height: 1.55;
  font-size: 13.5px;
  max-width: none;
  margin-bottom: 12px;
}

.news-article.news-article--html {
  white-space: normal;
}

.news-article.news-article--html p {
  margin: 0 0 0.55em;
}

.news-article.news-article--html p:last-child {
  margin-bottom: 0;
}

.news-article.news-article--html ul,
.news-article.news-article--html ol {
  margin: 0 0 0.55em 1.2em;
  padding: 0;
}

.news-article.news-article--html li {
  margin: 0.1em 0;
}

.news-gallery {
  margin-top: 8px;
}

.links-list {
  display: grid;
  gap: 10px;
}

.link-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(17,24,39,0.02);
  color: var(--ink);
  text-decoration: none;
}

a.link-row:hover {
  border-color: var(--stroke-strong);
}

.link-icon {
  width: 132px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  object-fit: contain;
  flex: 0 0 auto;
}

@media (max-width: 520px) {
  .link-icon {
    width: 112px;
    height: 64px;
  }
}

.link-body {
  min-width: 0;
}

.link-text {
  white-space: pre-line;
  line-height: 1.5;
}

.link-url {
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.judging-list {
  display: grid;
  gap: 14px;
}

.judging-show {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden;
}

.judging-show-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(17,24,39,0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.judging-show-header-main {
  min-width: 0;
}

.judging-show-title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.judging-show-date {
  font-weight: 850;
}

.judging-show-name {
  font-weight: 800;
}

.judging-show-meta {
  margin-top: 4px;
}

.judging-show-body {
  padding: 12px 14px;
  display: grid;
  gap: 12px;
}

.judging-toggle {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.judging-toggle:hover {
  background: rgba(255,255,255,0.12);
}

.judging-toggle-icon {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}

@media (min-width: 740px) {
  .judging-show--collapsed .judging-show-body {
    display: none;
  }

  .judging-show--collapsed .judging-toggle-icon {
    transform: rotate(-45deg);
  }
}

@media (max-width: 739px) {
  .judging-toggle {
    display: none;
  }
}

.judging-breed {
  padding-top: 6px;
  border-top: 1px solid var(--stroke);
}

.judging-breed:first-child {
  padding-top: 0;
  border-top: 0;
}

.judging-breed-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 750;
}

.judging-class {
  padding: 10px 10px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
}

.judging-class + .judging-class {
  margin-top: 10px;
}

.judging-class--major {
  border-color: var(--stroke-strong);
  background: rgba(17,24,39,0.03);
}

.judging-class-title {
  font-weight: 750;
  font-size: 13px;
}

.judging-class-breed {
  margin-left: 8px;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
}

.judging-awards {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.judging-award-line {
  font-size: 13px;
  line-height: 1.4;
}

.judging-award-breed {
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
}

.judging-award-breed--pill {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  font-weight: 700;
}

.form-row {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

label {
  font-size: 12px;
  color: var(--muted);
}

input, textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 13px;
}

textarea { min-height: 110px; resize: vertical; }

button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--stroke-strong);
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
}

button:hover {
  background: rgba(255,255,255,0.12);
}

.footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: 12px;
}

.footer-email {
  display: block;
  font-size: 14px;
  font-weight: 750;
  color: var(--ink);
  margin-bottom: 4px;
}

.footer-email a {
  color: inherit;
  text-decoration: none;
}

.footer-email a:hover {
  text-decoration: underline;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.gallery-grid.judging-gallery-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-grid.judging-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid.judging-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gallery-item {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(17,24,39,0.02);
  display: block;
}

.gallery-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.gallery-grid.judging-gallery-grid .gallery-item img {
  height: auto;
  aspect-ratio: 4 / 3;
}

.gallery-caption {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  min-height: 36px;
}

.gallery-grid.judging-gallery-grid .gallery-caption {
  display: none;
}

dialog.gallery-dialog {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 0;
  background: var(--panel);
  color: var(--ink);
  max-width: min(980px, calc(100vw - 24px));
  width: 100%;
}

dialog.gallery-dialog::backdrop {
  background: rgba(17,24,39,0.35);
}

.gallery-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(17,24,39,0.02);
}

.gallery-dialog-title {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}

.gallery-dialog-body {
  padding: 12px;
}

.gallery-dialog-body img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(74vh, 860px);
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--stroke);
}
