.territory-hero {
  color: #302318;
  background:
    linear-gradient(90deg, #f5e6ca 2%, #f6e7cc 29%, #f3e5cbdb 50%, #f6e4c62b 90%),
    url("ogliastra.webp") right 49% / cover no-repeat;
}
.territory-intro { padding-block: clamp(40px, 8vw, 94px) clamp(39px, 7vw, 82px); }
.territory-intro .eyebrow, .territory-callout .eyebrow { color: #803f2d; }
.territory-intro h1 { margin-block: 7px 12px; max-width: 13ch; }
.territory-intro h1 em { color: #813821; }
.territory-intro p:last-child { max-width: 43ch; }
.territory-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 21px;
  border-bottom: 1px solid #bba282;
}
.territory-nav a {
  padding: 11px 4px 9px;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 750;
  border-bottom: 2px solid transparent;
}
.territory-nav a:hover, .territory-nav a[aria-current] { color: #7e341f; border-color: #a14b31; }
.territory-content { padding-block: clamp(20px, 5vw, 54px) clamp(40px, 7vw, 88px); }
.territory-note { background: #f3e4ce; border-left: 3px solid #aa6041; padding: 11px 14px; margin-bottom: 15px; max-width: 75ch; }
.event-filters {
  display: grid;
  gap: 16px;
  margin-bottom: 13px;
  padding: 16px;
  background: #fcf4e5;
  border: 1px solid #cbb696;
  border-radius: 3px 17px 3px 3px;
}
.month-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.month-filter button {
  border: 1px solid #ab8d72;
  background: #fff8ec;
  color: #422c20;
  border-radius: 99px;
  min-height: 38px;
  padding: 4px 10px;
  font-weight: 650;
  cursor: pointer;
}
.month-filter button:hover, .month-filter button[aria-pressed="true"] {
  background: #823d29;
  border-color: #823d29;
  color: #fff7e8;
}
.filter-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
.filter-fields label { display: grid; gap: 4px; font-size: .86rem; font-weight: 750; }
.filter-fields input, .filter-fields select, .filter-reset {
  min-width: 0;
  min-height: 42px;
  border: 1px solid #a88b70;
  border-radius: 4px;
  background: #fffaf2;
  color: #392519;
  font: inherit;
  padding: 6px 8px;
}
.filter-reset { cursor: pointer; text-decoration: underline; }
#event-count { min-height: 1.5em; color: #713e2d; font-size: .85rem; font-weight: 700; }
.event-list, .map-sheets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(11px, 2vw, 24px); }
.event-card, .map-sheet {
  border: 1px solid #cab28e;
  border-radius: 4px 20px 4px 4px;
  padding: clamp(15px, 3vw, 27px);
  background: #fff8e9;
  scroll-margin-top: 24px;
}
.event-card:target, .map-sheet:target, .diary-entry:target { outline: 2px solid #a14b31; outline-offset: 3px; }
.event-card h2, .map-sheet h2, .diary-entry h2 { font-size: clamp(26px, 4vw, 48px); margin-block: 4px 11px; }
.event-card .eyebrow, .map-sheet .eyebrow, .diary-entry .eyebrow { color: #88452c; }
.event-period { display: flex; align-items: baseline; gap: 6px 10px; flex-wrap: wrap; margin-bottom: 10px; font-weight: 700; }
.event-status { font: 700 .72rem/1.2 var(--sans); padding: 5px 8px; border-radius: 4px; background: #ecd0b5; color: #5d2d1b; }
.event-status-confermato { background: #d8e6ca; color: #2c4223; }
.event-status-annunciato { background: #f0dec2; color: #5a391d; }
.event-status-da-monitorare { background: #e8e1d4; color: #483d32; }
.event-card .event-evidence { margin-block: 7px 10px; font-size: .85rem; color: #684d3f; }
.event-card small { display: block; color: #684d3f; margin-top: 10px; }
.territory-links { display: flex; flex-wrap: wrap; gap: 5px 15px; padding: 0; margin: 11px 0 0; list-style: none; }
.territory-links a, .sources-block a { font-size: .85rem; font-weight: 700; }
.territory-links a:hover, .sources-block a:hover { color: #873921; }
.sources-block { margin-top: 33px; padding-top: 19px; border-top: 1px solid #b59a79; }
.sources-block h2 { font-size: clamp(25px, 4vw, 43px); }
.sources-block ul { columns: 2; padding-left: 20px; }
.sources-block li { margin-bottom: 5px; break-inside: avoid; }

.map-overview { margin-bottom: 25px; }
.map-reveal {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #443126;
  color: #fff3db;
  border-radius: 4px 23px 4px 4px;
}
.map-reveal > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.map-reveal::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #2e2017ed, #2e201755); z-index: -1; }
.map-reveal-copy { padding: clamp(18px, 5vw, 48px); }
.map-reveal-copy h2 { margin: 6px 0 10px; }
.map-reveal-copy p { max-width: 40ch; }
.map-reveal-copy .btn { margin: 12px 0 7px; background: #f5e2bd; color: #382419; }
.map-reveal-copy small { display: block; }
.map-frame { padding: 0 12px 13px; }
.map-frame iframe { display: block; width: 100%; height: clamp(310px, 53vw, 580px); background: #f5e9d4; border: 0; }
.map-frame > a { display: inline-block; padding: 8px 0 0; font-size: .86rem; }
.map-index {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-block: 13px;
}
.map-index a {
  padding: 8px 12px;
  border: 1px solid #af9274;
  font-weight: 700;
  border-radius: 99px;
  font-size: .86rem;
}
.map-index span { margin-left: 3px; }
.map-town-link { margin-block: 13px; }
.map-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; margin-top: 15px; }
.map-facts > div { border-top: 1px solid #d1bb99; padding-top: 4px; }
.map-facts dt { color: #81442f; font-size: .77rem; font-weight: 750; }
.map-facts dd { margin: 2px 0 0; }
.primary-link { color: #843720; }

.diary-list { display: grid; gap: 23px; }
.diary-entry {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  background: #fff7e6;
  border: 1px solid #bda383;
  border-radius: 4px 21px 4px 4px;
  overflow: hidden;
  scroll-margin-top: 25px;
}
.diary-entry figure { position: relative; margin: 0; background: #448173; min-height: 235px; }
.diary-entry figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.diary-entry:last-child figure { background: #402b20; }
.diary-entry:last-child figure img { object-fit: contain; padding: 15px; }
.diary-entry figcaption { position: absolute; bottom: 0; inset-inline: 0; background: #2c1e14d9; color: #fff3db; padding: 5px 12px; font-size: .74rem; }
.diary-body { padding: clamp(17px, 4vw, 33px); }
.diary-body p + p { margin-top: 9px; }
.diary-actions { display: flex; gap: 9px 13px; align-items: center; flex-wrap: wrap; margin-top: 15px; }
.diary-actions .btn, .territory-callout .btn { background: #823d29; color: #fff8e7; }
.territory-callout {
  margin-block: 28px;
  border-top: 1px solid #ad9073;
  border-bottom: 1px solid #ad9073;
  padding-block: clamp(19px, 4vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
}
.territory-callout h2 { margin: 3px 0 7px; font-size: clamp(29px, 4vw, 54px); }
.territory-callout .btn { margin-right: 9px; }
.atlas-territory-link { margin-block: 14px; }
@media (max-width: 900px) {
  .filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .territory-hero {
    background: linear-gradient(90deg, #f5e6caf7, #f3e5cbdc 78%, #f6e4c6b0), url("ogliastra.webp") right center / cover no-repeat;
  }
  .event-list, .map-sheets, .diary-entry { grid-template-columns: 1fr; }
  .diary-entry figure { min-height: 175px; }
  .sources-block ul { columns: 1; }
}
.map-frame-detail { padding: 0; margin-top: 13px; }
.map-frame-detail iframe { height: clamp(250px, 34vw, 380px); }

.home-territory-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 17px; }
.home-territory-links > a { font-weight: 700; }
.calendar-highlight {
  padding: clamp(14px, 3vw, 25px);
  margin: 16px 0;
  background: #faf1df;
  color: #322116;
  border: 1px solid #cfb695;
  border-left: 4px solid #8e4d36;
  border-radius: 3px 15px 3px 3px;
}
.calendar-highlight h2, .calendar-month-title { font-size: clamp(24px, 3.3vw, 41px); margin-bottom: 6px; }
.calendar-highlight a { display: inline-block; font-weight: 700; margin-top: 8px; }
.event-filters .month-filter { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.month-filter button:first-child { grid-column: 1 / -1; justify-self: start; }
@media(max-width: 810px) {
  .event-filters .month-filter { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media(max-width: 490px) {
  .event-filters .month-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .month-filter button { padding-inline: 4px; font-size: .72rem; }
}
.map-overview-panel {
  padding: clamp(13px, 3vw, 24px);
  background: #fff7e6;
  border: 1px solid #bc9e79;
  border-radius: 4px 20px 4px 4px;
}
.map-overview-heading h2, .route-place-picker h2 { font-size: clamp(28px, 4vw, 48px); margin: 0 0 7px; }
.map-overview-layout {
  display: grid;
  grid-template-columns: minmax(150px, .72fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 16px clamp(19px, 5vw, 66px);
}
.map-context {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 10px;
  text-align: center;
  background: #f3e9d6;
  border-radius: 3px 14px 3px 3px;
}
.map-context img { width: auto; height: clamp(154px, 31vw, 300px); object-fit: contain; }
.map-context figcaption { font-size: .73rem; }
.map-overview-heading .btn { margin-top: 13px; }
.map-overview-panel .map-frame { margin-top: 14px; padding: 0; }
@media (max-width: 590px) {
  .map-overview-layout { grid-template-columns: 1fr; }
}
.route-place-picker {
  border: 1px solid #bc9e79;
  background: #fff5e3;
  border-radius: 4px 20px 4px 4px;
  padding: clamp(15px, 3vw, 26px);
}
.route-places { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0 13px; }

.home-territory {
  padding-inline: clamp(12px, 3vw, 34px);
  background:
    radial-gradient(ellipse at 84% 12%, #dfe2c66b, transparent 57%),
    radial-gradient(ellipse at 53% 88%, #edd4a864, transparent 66%),
    #fbf2e4;
  border: 1px solid #d6c2a7;
  border-radius: 4px 20px 4px 4px;
}

@media (min-width: 760px) {
  .home-territory {
    position: relative;
    isolation: isolate;
    overflow: hidden;
  }
  .home-territory::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 4% 0 auto;
    width: min(28%, 260px);
    background: url("erbario-macchia.webp") center / contain no-repeat;
    opacity: .13;
    pointer-events: none;
  }
}

.guide-hero-grid, .guide-blog-feature {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: clamp(14px, 4vw, 44px);
}
.guide-hero-grid { padding-block: clamp(22px, 5vw, 64px); }
.guide-hero-grid img, .guide-blog-feature img {
  display: block;
  width: 100%;
  max-height: 290px;
  object-fit: cover;
  border-radius: 6px 22px 6px 6px;
}
.guide-blog-feature {
  padding: clamp(15px, 3vw, 26px);
  margin-bottom: 25px;
  background: #fff2db;
  border: 1px solid var(--line);
  border-radius: 6px 22px 6px 6px;
}
.guide-blog-feature img { max-height: 198px; }
.guide-content > section { scroll-margin-top: 90px; margin-bottom: clamp(26px, 6vw, 78px); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 242px), 1fr)); gap: 14px; }
.guide-card { padding: 18px; border: 1px solid var(--line); border-radius: 6px 18px 6px 6px; background: #fff5e5; }
.guide-card h3, .guide-events h3 { margin: 0 0 6px; }
.guide-events { list-style: none; margin: 20px 0; padding: 0; }
.guide-events li { display: grid; grid-template-columns: minmax(9rem, 24%) 1fr; gap: 12px; border-top: 1px solid var(--line); padding: 13px 0; }
.guide-period { color: #71301f; font-weight: 750; }
.guide-events p { margin: 0; }
@media (max-width: 640px) {
  .guide-hero-grid, .guide-blog-feature, .guide-events li { grid-template-columns: 1fr; }
  .guide-events li { gap: 4px; }
}
